You are not logged in.
Hi all,
I'd like to get all my players to rely on the same keystrokes. The XF86AudioPlay/XF86AudioNext etc. etc. keystrokes seem to be exactly what I want, but simulating those keystrokes (since I don't have those keys on my keyboard) doesn't seem possible without 'gotchas'.
The current methods I've found are:-
xdotool key XF86AudioPlay
echo 'KeyStrPress XF86AudioPlay KeyStrRelease XF86AudioPlay' | xmacroplay :0
xte 'keydown XF86AudioPlay' 'keyup XF86AudioPlay'
xvkbd -text "\[XF86AudioPlay]\r"
All of them work (from the xdotool, xmacro, xautomation, and xvkbd packages respectively) but don't work in conjunction with xbindkeys bindings. Basically, when I put them in under Super-C (my preferred keybinding for playing), they don't take any effect, unless I press Super-C very quickly (basically just tapping).
The primary problem seems to be that when I hold the Super key down, those commands issue Super-XF86AudioPlay rather than just XF86AudioPlay. xdotool actually has a --clearmodifiers option for that, but it doesn't seem to make things better.
Any other solutions for what I'm trying to do (bind Super-C to issue XF86AudioPlay because my keyboard does not have music buttons)? Currently my Super-C is bound with xbindkeys to 'mpc toggle' which works, but only for mpd.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Really old bump. Been working around by hard-coding mpc, but I just got a new external speaker with buttons I'd like to use.
Same question still, anyway to emulate XF86AudioPlay (or any of the XF86Audio keys) with a Super-related combo?
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Offline
Doesn't work all the time here, similar to previously I've found that it only works if I 'tap' the keys really fast.
When running xbindkeys -v, I notice the times when it works it looks like this:-
Key press !
e.xkey.keycode=19
e.xkey.state=80
"echo 'KeyStrRelease Mod4 KeyStrRelease Mod2 KeyStrRelease 0 KeyStrPress XF86AudioMute KeyStrRelease XF86AudioMute KeyStrRelease Mod4 KeyStrRelease 0' | xmacroplay :0"
m:0x40 + c:19
Mod4 + 0
got screen 0 for window 15a
Start program with fork+exec call
Key release !
e.xkey.keycode=133
e.xkey.state=80
Key release !
e.xkey.keycode=19
e.xkey.state=16
XTest for server ":0.0" is version 2.2.
KeyStrRelease: Mod4
KeyStrRelease: Mod2
KeyStrRelease: 0
KeyStrPress: XF86AudioMute
KeyStrRelease: XF86AudioMute
KeyStrRelease: Mod4
KeyStrRelease: 0
Unknown tag: 0
xmacroplay: pointer and keyboard released.
Key press !
e.xkey.keycode=19
e.xkey.state=80
"echo 'KeyStrRelease Mod4 KeyStrRelease Mod2 KeyStrRelease 0 KeyStrPress XF86AudioMute KeyStrRelease XF86AudioMute KeyStrRelease Mod4 KeyStrRelease 0' | xmacroplay :0"
m:0x40 + c:19
Mod4 + 0
got screen 0 for window 15a
Start program with fork+exec call
XTest for server ":0.0" is version 2.2.
KeyStrRelease: Mod4
KeyStrRelease: Mod2
KeyStrRelease: 0
KeyStrPress: XF86AudioMute
KeyStrRelease: XF86AudioMute
KeyStrRelease: Mod4
KeyStrRelease: 0
Unknown tag: 0
xmacroplay: pointer and keyboard released.
Key release !
e.xkey.keycode=19
e.xkey.state=80
Looks like a race condition.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Ugly, dirty, terrible, horrific, Not Safe for Human Consumption HACK:
echo 'KeyStrRelease Super_L KeyStrRelease c' | xmacroplay :0; xmodmap -e 'remove Mod4 = Super_L'; echo 'KeyStrPress XF86AudioPlay KeyStrRelease XF86AudioPlay' | xmacroplay :0; xmodmap -e 'add Mod4 = Super_L'
Offline
Damn cool. That works. So hacky though. Thanks much, sir.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Slight addition, the code you've posted works just fine, but I can double tap (for example) Super-minus to continually lower volume. This is what I have, modified:-
echo 'KeyStrRelease Super_L KeyStrRelease minus' | xmacroplay :0; xmodmap -e 'remove Mod4 = Super_L'; echo 'KeyStrPress XF86AudioLowerVolume KeyStrRelease XF86AudioLowerVolume' | xmacroplay :0; xmodmap -e 'add Mod4 = Super_L'; echo 'KeyStrPress Super_L' | xmacroplay :0
The issue with that is if you tap Super-Minus really fast (such that you release before the last KeyStrPress executes you're left with a permanently held down state for Super_L (which can confuse you if your keys start doing what you don't expect them to). Just pressing Super_L again makes this go away though.
Time to update the wiki....
EDIT: and its up http://wiki.archlinux.org/index.php/Xbi … media_keys Thanks Stebalien for your invaluable help.
Last edited by ngoonee (2010-10-22 01:44:09)
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline