You are not logged in.
I'm looking for a way to globally map Shift+Insert to Super_L+p for easier finger access to primary buffer pasting across terminal and gtk apps.
I'm trying to do this with xdotool.
Relevant lines from my config.h:
...
#define MODKEY Mod4Mask
...
static const char *pastecmd[] = { "xdotool", "key", "--clearmodifiers", "Shift+Insert", NULL };
...
{ MODKEY, XK_p, spawn, {.v = pastecmd } },
...After compiling and restarting, Mod4+p doesn't work as I'd expect (i.e. nothing happens when super+p is pressed).
Running "xdotool key --clearmodifiers Shift+Insert" from shell and dmenu works (primary buffer is pasted).
Running "sleep 5 && xdotool key --clearmodifiers Shift+Insert" from shell and dmenu, then focussing a text box in a gtk app such as Firefox within 5 seconds also works.
Looking for info on why this isn't working?
Perhaps theres another tool or way of mapping key combos that would do this job. Suggestions?
All configs @ https://github.com/w0ng
Offline
try xbindkeys.
Last edited by x33a (2012-07-25 12:16:33)
Offline
Doesn't work with xbindkeys.
~/.xbindkeysrc
"xdotool key --delay 0 --clearmodifiers Shift+Insert"
m:0x40 + c:33
Mod4 + pxev output after the mapping:
KeyPress event, serial 29, synthetic NO, window 0xe00001,
root 0x157, subw 0x0, time 11820231, (486,597), root:(488,613),
state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XKeysymToKeycode returns keycode: 108
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False
FocusOut event, serial 32, synthetic NO, window 0xe00001,
mode NotifyGrab, detail NotifyAncestor
MappingNotify event, serial 32, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
MappingNotify event, serial 33, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusIn event, serial 33, synthetic NO, window 0xe00001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 33, synthetic NO, window 0x0,
keys: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
KeyRelease event, serial 34, synthetic NO, window 0xe00001,
root 0x157, subw 0x0, time 11821150, (486,597), root:(488,613),
state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
XKeysymToKeycode returns keycode: 108
XLookupString gives 0 bytes:
XFilterEvent returns: Falsexbindkeys -k after mapping:
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"NoCommand"
m:0x40 + c:133
Mod4 + Super_L(the same xev and xbindkeys -k output occurs when doing the mapping in dwm's config.h)
All configs @ https://github.com/w0ng
Offline
Going with the xdotool route, have you tried using the SHCMD macro and/or using:
static const char *pastecmd[] = { "/bin/sh", "-c", "xdotool key --clearmodifiers Shift+Insert", NULL };"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Maybe it's a keyboard problem? What kind of keyboard are you using?
Offline
@Trilby
Yep. I tried with that line and SHCMD directly with this line before posting this question:
{ MODKEY, XK_p, spawn, SHCMD("xdotool key --clearmodifiers Shift+Insert") },@x33a
Using Leopold FC700r plugged into PS/2. It's a month or two old and everything working fine that I'm aware of.
Maybe not related, but I'm also using these in my ~/.xinitrc before dwm is launched.
# remap caps lock to escape, remap right alt to window key
setxkbmap -option caps:escape
xmodmap -e "keycode 108 = Super_L"
xmodmap -e "remove mod1 = Super_L"All configs @ https://github.com/w0ng
Offline
Maybe the xmodmap lines are interfering somehow? Try commenting them out and see if it makes a difference.
Offline
Tried without the setxkbmap and xmodmapping in xinitrc and with and without --clearmodifiers.
Still couldn't get it to work.
I'll stop trying until I get another keyboard to see if it is a keyboard problem
All configs @ https://github.com/w0ng
Offline