xdotool messes up keyboard input2019 Community Moderator ElectionGetting direct input from keyboard, ignoring XFiltering the keyboard inputCompile the Ubuntu “Raring” Kernel with the Intel Compilerlinux udev rule to load gadget module for client driverConnect a keyboard / IR controller to a command line program running in a screenType some text with xdotool independently of the keyboard layoutRapidFire input with xdotool and xbindkeysHow to combine conditions with xdotool?Xdotool action without focusingxdotool getmouselocation and getwindowgeometry Y location inconsistency
Can someone explain how this makes sense electrically?
Drawing a topological "handle" with Tikz
Why did the HMS Bounty go back to a time when whales are already rare?
What is this type of notehead called?
Varistor? Purpose and principle
Journal losing indexing services
When quoting, must I also copy hyphens used to divide words that continue on the next line?
What's the difference between 違法 and 不法?
How do you respond to a colleague from another team when they're wrongly expecting that you'll help them?
Engineer refusing to file/disclose patents
Why do IPv6 unique local addresses have to have a /48 prefix?
Open a doc from terminal, but not by its name
Reply 'no position' while the job posting is still there
A Permanent Norse Presence in America
Freedom of speech and where it applies
How much character growth crosses the line into breaking the character
Is a model fitted to data or is data fitted to a model?
Can I use my Chinese passport to enter China after I acquired another citizenship?
Difference between -| and |- in TikZ
Greco-Roman egalitarianism
Will the technology I first learn determine the direction of my future career?
Divine apple island
How to color a curve
How will losing mobility of one hand affect my career as a programmer?
xdotool messes up keyboard input
2019 Community Moderator ElectionGetting direct input from keyboard, ignoring XFiltering the keyboard inputCompile the Ubuntu “Raring” Kernel with the Intel Compilerlinux udev rule to load gadget module for client driverConnect a keyboard / IR controller to a command line program running in a screenType some text with xdotool independently of the keyboard layoutRapidFire input with xdotool and xbindkeysHow to combine conditions with xdotool?Xdotool action without focusingxdotool getmouselocation and getwindowgeometry Y location inconsistency
I'm trying to create some scripts using xev and xdotool to allow me to record and re-play macros in linux. I've got the recording working with xev, and the replaying mostly works but appears to leave my X session in a weird state. I've got a macro file like this:
keydown e
keyup e
keydown c
keydown h
keyup c
keydown o
keyup h
keyup o
keydown space
keyup space
keydown apostrophe
keyup apostrophe
keydown h
keydown i
keyup h
keyup i
keydown apostrophe
keyup apostrophe
and I'm trying to use it with cat macro.txt | xargs xdotool
. This types out my text in the terminal, but after it finishes, most of my keys don't work anymore; they either print out control characters, or they just don't do anything. I've had to restart my computer a couple times to get it re-set. Any idea how I can avoid this or what is going on? Or even what a good linux macro tool might be?
linux keyboard xdotool
add a comment |
I'm trying to create some scripts using xev and xdotool to allow me to record and re-play macros in linux. I've got the recording working with xev, and the replaying mostly works but appears to leave my X session in a weird state. I've got a macro file like this:
keydown e
keyup e
keydown c
keydown h
keyup c
keydown o
keyup h
keyup o
keydown space
keyup space
keydown apostrophe
keyup apostrophe
keydown h
keydown i
keyup h
keyup i
keydown apostrophe
keyup apostrophe
and I'm trying to use it with cat macro.txt | xargs xdotool
. This types out my text in the terminal, but after it finishes, most of my keys don't work anymore; they either print out control characters, or they just don't do anything. I've had to restart my computer a couple times to get it re-set. Any idea how I can avoid this or what is going on? Or even what a good linux macro tool might be?
linux keyboard xdotool
Does the sample you posted always cause that weird state, or only sometimes? Runxev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.
– Gilles
Mar 13 '17 at 23:39
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42
add a comment |
I'm trying to create some scripts using xev and xdotool to allow me to record and re-play macros in linux. I've got the recording working with xev, and the replaying mostly works but appears to leave my X session in a weird state. I've got a macro file like this:
keydown e
keyup e
keydown c
keydown h
keyup c
keydown o
keyup h
keyup o
keydown space
keyup space
keydown apostrophe
keyup apostrophe
keydown h
keydown i
keyup h
keyup i
keydown apostrophe
keyup apostrophe
and I'm trying to use it with cat macro.txt | xargs xdotool
. This types out my text in the terminal, but after it finishes, most of my keys don't work anymore; they either print out control characters, or they just don't do anything. I've had to restart my computer a couple times to get it re-set. Any idea how I can avoid this or what is going on? Or even what a good linux macro tool might be?
linux keyboard xdotool
I'm trying to create some scripts using xev and xdotool to allow me to record and re-play macros in linux. I've got the recording working with xev, and the replaying mostly works but appears to leave my X session in a weird state. I've got a macro file like this:
keydown e
keyup e
keydown c
keydown h
keyup c
keydown o
keyup h
keyup o
keydown space
keyup space
keydown apostrophe
keyup apostrophe
keydown h
keydown i
keyup h
keyup i
keydown apostrophe
keyup apostrophe
and I'm trying to use it with cat macro.txt | xargs xdotool
. This types out my text in the terminal, but after it finishes, most of my keys don't work anymore; they either print out control characters, or they just don't do anything. I've had to restart my computer a couple times to get it re-set. Any idea how I can avoid this or what is going on? Or even what a good linux macro tool might be?
linux keyboard xdotool
linux keyboard xdotool
asked Mar 13 '17 at 19:01
jstaabjstaab
1233
1233
Does the sample you posted always cause that weird state, or only sometimes? Runxev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.
– Gilles
Mar 13 '17 at 23:39
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42
add a comment |
Does the sample you posted always cause that weird state, or only sometimes? Runxev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.
– Gilles
Mar 13 '17 at 23:39
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42
Does the sample you posted always cause that weird state, or only sometimes? Run
xev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.– Gilles
Mar 13 '17 at 23:39
Does the sample you posted always cause that weird state, or only sometimes? Run
xev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.– Gilles
Mar 13 '17 at 23:39
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42
add a comment |
1 Answer
1
active
oldest
votes
I made my own custom macro using Linux Mint's Keyboard Shortcuts and adding a custom shortcut. I managed to get it to work by using --clearmodifiers
, like so:
xdotool key --clearmodifiers Up
See if that helps.
Also, here's what the manual says on it:
CLEARMODIFIERS
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them
afterwards.For example, if you were to run this command:
xdotool key a
The result would be 'a' or 'A' depending on whether or not you were holding the shift key on your keyboard. Often it is undesirable to have any modifiers active, so you can tell xdotool to clear any active modifiers.
The order of operations if you hold shift while running 'xdotool key --clearmodifiers a' is this:
1. Query for all active modifiers (finds shift, in this case)
2. Try to clear shift by sending 'key up' for the shift key
3. Runs normal 'xdotool key a'
4. Restore shift key by sending 'key down' for shift
The --clearmodifiers flag can currently clear of the following:
· any key in your active keymap that has a modifier associated with it. (See xmodmap(1)'s 'xmodmap -pm' output)
· mouse buttons (1, 2, 3, 4, and 5)
· caps lock
New contributor
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f351223%2fxdotool-messes-up-keyboard-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I made my own custom macro using Linux Mint's Keyboard Shortcuts and adding a custom shortcut. I managed to get it to work by using --clearmodifiers
, like so:
xdotool key --clearmodifiers Up
See if that helps.
Also, here's what the manual says on it:
CLEARMODIFIERS
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them
afterwards.For example, if you were to run this command:
xdotool key a
The result would be 'a' or 'A' depending on whether or not you were holding the shift key on your keyboard. Often it is undesirable to have any modifiers active, so you can tell xdotool to clear any active modifiers.
The order of operations if you hold shift while running 'xdotool key --clearmodifiers a' is this:
1. Query for all active modifiers (finds shift, in this case)
2. Try to clear shift by sending 'key up' for the shift key
3. Runs normal 'xdotool key a'
4. Restore shift key by sending 'key down' for shift
The --clearmodifiers flag can currently clear of the following:
· any key in your active keymap that has a modifier associated with it. (See xmodmap(1)'s 'xmodmap -pm' output)
· mouse buttons (1, 2, 3, 4, and 5)
· caps lock
New contributor
add a comment |
I made my own custom macro using Linux Mint's Keyboard Shortcuts and adding a custom shortcut. I managed to get it to work by using --clearmodifiers
, like so:
xdotool key --clearmodifiers Up
See if that helps.
Also, here's what the manual says on it:
CLEARMODIFIERS
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them
afterwards.For example, if you were to run this command:
xdotool key a
The result would be 'a' or 'A' depending on whether or not you were holding the shift key on your keyboard. Often it is undesirable to have any modifiers active, so you can tell xdotool to clear any active modifiers.
The order of operations if you hold shift while running 'xdotool key --clearmodifiers a' is this:
1. Query for all active modifiers (finds shift, in this case)
2. Try to clear shift by sending 'key up' for the shift key
3. Runs normal 'xdotool key a'
4. Restore shift key by sending 'key down' for shift
The --clearmodifiers flag can currently clear of the following:
· any key in your active keymap that has a modifier associated with it. (See xmodmap(1)'s 'xmodmap -pm' output)
· mouse buttons (1, 2, 3, 4, and 5)
· caps lock
New contributor
add a comment |
I made my own custom macro using Linux Mint's Keyboard Shortcuts and adding a custom shortcut. I managed to get it to work by using --clearmodifiers
, like so:
xdotool key --clearmodifiers Up
See if that helps.
Also, here's what the manual says on it:
CLEARMODIFIERS
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them
afterwards.For example, if you were to run this command:
xdotool key a
The result would be 'a' or 'A' depending on whether or not you were holding the shift key on your keyboard. Often it is undesirable to have any modifiers active, so you can tell xdotool to clear any active modifiers.
The order of operations if you hold shift while running 'xdotool key --clearmodifiers a' is this:
1. Query for all active modifiers (finds shift, in this case)
2. Try to clear shift by sending 'key up' for the shift key
3. Runs normal 'xdotool key a'
4. Restore shift key by sending 'key down' for shift
The --clearmodifiers flag can currently clear of the following:
· any key in your active keymap that has a modifier associated with it. (See xmodmap(1)'s 'xmodmap -pm' output)
· mouse buttons (1, 2, 3, 4, and 5)
· caps lock
New contributor
I made my own custom macro using Linux Mint's Keyboard Shortcuts and adding a custom shortcut. I managed to get it to work by using --clearmodifiers
, like so:
xdotool key --clearmodifiers Up
See if that helps.
Also, here's what the manual says on it:
CLEARMODIFIERS
Any command taking the --clearmodifiers flag will attempt to clear any active input modifiers during the command and restore them
afterwards.For example, if you were to run this command:
xdotool key a
The result would be 'a' or 'A' depending on whether or not you were holding the shift key on your keyboard. Often it is undesirable to have any modifiers active, so you can tell xdotool to clear any active modifiers.
The order of operations if you hold shift while running 'xdotool key --clearmodifiers a' is this:
1. Query for all active modifiers (finds shift, in this case)
2. Try to clear shift by sending 'key up' for the shift key
3. Runs normal 'xdotool key a'
4. Restore shift key by sending 'key down' for shift
The --clearmodifiers flag can currently clear of the following:
· any key in your active keymap that has a modifier associated with it. (See xmodmap(1)'s 'xmodmap -pm' output)
· mouse buttons (1, 2, 3, 4, and 5)
· caps lock
New contributor
New contributor
answered yesterday
AndrewAndrew
1012
1012
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f351223%2fxdotool-messes-up-keyboard-input%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Does the sample you posted always cause that weird state, or only sometimes? Run
xev
from a terminal and, when the keys don't work, type one of the keys in the xev window and copy-paste the paragraph that begins with “KeyPress event”. Try pressing and releasing modifiers, in case the problem was a stuck modifier.– Gilles
Mar 13 '17 at 23:39
I don't really want to try it again since I'll probably have to restart my computer, but it does seem like a stuck modifier, since it behaved differently each time I did it. The first time it just printed out a control character no matter what key I pressed; the second time it didn't print anything. Why would modifiers get stuck? This smells like a race condition, which would be weird.
– jstaab
Mar 14 '17 at 15:42