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
For airliners, what prevents wing strikes on landing in bad weather?
Word describing multiple paths to the same abstract outcome
Visiting the UK as unmarried couple
Golf game boilerplate
How can I raise concerns with a new DM about XP splitting?
What to do when my ideas aren't chosen, when I strongly disagree with the chosen solution?
Why is delta-v is the most useful quantity for planning space travel?
Did US corporations pay demonstrators in the German demonstrations against article 13?
How to check participants in at events?
Hostile work environment after whistle-blowing on coworker and our boss. What do I do?
What (else) happened July 1st 1858 in London?
Indicating multiple different modes of speech (fantasy language or telepathy)
Teaching indefinite integrals that require special-casing
Why are on-board computers allowed to change controls without notifying the pilots?
How do ultrasonic sensors differentiate between transmitted and received signals?
Can I create an upright 7-foot × 5-foot wall with the Minor Illusion spell?
Are taller landing gear bad for aircraft, particulary large airliners?
What is the opposite of 'gravitas'?
Simple recursive Sudoku solver
Lifted its hind leg on or lifted its hind leg towards?
Does "Dominei" mean something?
What do you call the infoboxes with text and sometimes images on the side of a page we find in textbooks?
Pronouncing Homer as in modern Greek
Can I rely on these GitHub repository files?
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 2 days ago
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
-keyboard, linux, xdotool
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