Unable to bind Print key in openbox
Unable to bind Print key in openbox
Hi!
Has anyone successfully been able to bind a command to the Print (PrtScn) key in Openbox in Lucid 5.2.5? The Pause key works, but Print and Scroll_Lock do not. It seems sensible to bind Print to execute scrot or mtpaintsnapshot.sh, but it is not working.
Has anyone successfully been able to bind a command to the Print (PrtScn) key in Openbox in Lucid 5.2.5? The Pause key works, but Print and Scroll_Lock do not. It seems sensible to bind Print to execute scrot or mtpaintsnapshot.sh, but it is not working.
Okay. thanks! I am familiar with xbindkeys, but I was hoping to use the OpenBox keybinding mechanism in rc.xml, and hoping there was an explanation for why the the Print key doesn't work in OpenBox in 5.2.5. xev shows it as working fine, but no joy using Print in rc.xml.
[Edit]
OTOH: i just tried xbindkeys, and it does work with the Print key. I guess "actually working" is a virtue Thanks pemasu.
It's funny, i had bundled up some scripts I use in rexbang with xbindkeys, hoping to make a pet that didn't conflict interfere with other peoples rc.xml, only to discover that many people are already using xbindkeys. I think i know why
I would still love to hear from someone who managed to successfully use the Print key with rc.xml.
[Edit]
OTOH: i just tried xbindkeys, and it does work with the Print key. I guess "actually working" is a virtue Thanks pemasu.
It's funny, i had bundled up some scripts I use in rexbang with xbindkeys, hoping to make a pet that didn't conflict interfere with other peoples rc.xml, only to discover that many people are already using xbindkeys. I think i know why
I would still love to hear from someone who managed to successfully use the Print key with rc.xml.
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
I had this problem with JWM and managed to solve it by using the keycode number:
You might want to make sure that it is actually recognized and not overlapped (like in my case):
The Openbox documentation (didn't work for me: google cache solved it), seems to imply they use the hex values: so I guess you want replace the "C-0x87" with "0x6F" (assuming your Print key is 111... I just googled "111 in hex".)
Code: Select all
<Key keycode="111">exec:mtpaint -s</Key>
Code: Select all
xmodmap -pk | grep '(Print)' 92 0xff61 (Print) 0xff15 (Sys_Req) 111 0xff61 (Print) 0xff15 (Sys_Req)
Code: Select all
<keyboard>
...
<keybind key="C-0x87">
<action name="ShowMenu">
<menu>root-menu</menu>
</action>
</keybind>
...
</keyboard>
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
I am currently trying to put together an Openbox tutorial here http://www.murga-linux.com/puppy/viewto ... 539#527539. Will try to add keybindings to that using the info here thanks.
Spup Frugal HD and USB
Root forever!
Root forever!
type xev
To get the number associated with a key you just have to type 'xev' in
the terminal. However if it is assigned to a program already you have to
quit from X server and get a prompt to type 'xev'
I got the following good info from wikipedia...
_______________________________________________________
the terminal. However if it is assigned to a program already you have to
quit from X server and get a prompt to type 'xev'
I got the following good info from wikipedia...
Code: Select all
Using xev
Another way to get the keycodes of your keys is to use the graphical X program "xev" (without having to switch to a console environment). With the following line you can start xev and directly grep the important parts:
xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'
In the example below I pressed the "a", "r", "c" and "h" keys and two of the media keys on my Dell keyboard. This gives me the following output:
38 a
27 r
54 c
43 h
153 NoSymbol
144 NoSymbol
This means that the "a", "r", "c" and "h" keys have the keycodes 38, 27, 54 and 43 and are properly bound while the media keys with the keycodes 153 and 144 have no function yet, which is indicated by "NoSymbol". If you press a key and nothing appears in the terminal, this means that the kernel doesn't see that key or that it is not mapped.
- Dougal
- Posts: 2502
- Joined: Wed 19 Oct 2005, 13:06
- Location: Hell more grotesque than any medieval woodcut
Re: type xev
My post above shows how to do it with xmodmap.don570 wrote:To get the number associated with a key you just have to type 'xev' in
the terminal. However if it is assigned to a program already you have to
quit from X server and get a prompt to type 'xev'
What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
Some say your nose
Some say your toes
But I think it's your mind
- ASRI éducation
- Posts: 3197
- Joined: Sat 09 May 2009, 12:10
- Location: France
- Contact: