| Author |
Message |
lithpr

Joined: 10 Mar 2011 Posts: 186
|
Posted: Wed 25 May 2011, 15:27 Post subject:
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.
|
|
Back to top
|
|
 |
pemasu

Joined: 08 Jul 2009 Posts: 5167 Location: Finland
|
Posted: Wed 25 May 2011, 15:39 Post subject:
|
|
I use for keybinding xbindkeys and xbindkeys-config apps. Then I drag symlink of xbindkeys to the /root/Startup to produce those keybindings.
You can get example .xbindkeysrc from fluppies, snow puppies, ice puppies, or most Iguleders puppies.
|
|
Back to top
|
|
 |
lithpr

Joined: 10 Mar 2011 Posts: 186
|
Posted: Wed 25 May 2011, 17:56 Post subject:
|
|
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.
|
|
Back to top
|
|
 |
Dougal

Joined: 19 Oct 2005 Posts: 2505 Location: Hell more grotesque than any medieval woodcut
|
Posted: Thu 26 May 2011, 09:03 Post subject:
|
|
I had this problem with JWM and managed to solve it by using the keycode number: | Code: | | <Key keycode="111">exec:mtpaint -s</Key> |
You might want to make sure that it is actually recognized and not overlapped (like in my case): | Code: | | xmodmap -pk | grep '(Print)' 92 0xff61 (Print) 0xff15 (Sys_Req) 111 0xff61 (Print) 0xff15 (Sys_Req) |
The Openbox documentation (didn't work for me: google cache solved it), seems to imply they use the hex values: | Code: | <keyboard>
...
<keybind key="C-0x87">
<action name="ShowMenu">
<menu>root-menu</menu>
</action>
</keybind>
...
</keyboard> | so I guess you want replace the "C-0x87" with "0x6F" (assuming your Print key is 111... I just googled "111 in hex".)
_________________ What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
|
|
Back to top
|
|
 |
lithpr

Joined: 10 Mar 2011 Posts: 186
|
Posted: Thu 26 May 2011, 16:53 Post subject:
|
|
Dougal,
BOOYAH! <keybind key="0x6F"> did the trick.
Thank you very much!
Lithpr
|
|
Back to top
|
|
 |
DaveS

Joined: 09 Oct 2008 Posts: 3669 Location: UK
|
Posted: Fri 27 May 2011, 00:47 Post subject:
|
|
I am currently trying to put together an Openbox tutorial here http://www.murga-linux.com/puppy/viewtopic.php?p=527539#527539. Will try to add keybindings to that using the info here thanks.
_________________ Spup Frugal HD and USB
Root forever!
|
|
Back to top
|
|
 |
don570

Joined: 10 Mar 2010 Posts: 2457 Location: Ontario
|
Posted: Sat 28 May 2011, 11:56 Post subject:
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...
| Code: |
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. |
_______________________________________________________
|
|
Back to top
|
|
 |
Dougal

Joined: 19 Oct 2005 Posts: 2505 Location: Hell more grotesque than any medieval woodcut
|
Posted: Sat 28 May 2011, 15:30 Post subject:
Re: type xev |
|
| 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' |
My post above shows how to do it with xmodmap.
_________________ What's the ugliest part of your body?
Some say your nose
Some say your toes
But I think it's your mind
|
|
Back to top
|
|
 |
lithpr

Joined: 10 Mar 2011 Posts: 186
|
Posted: Sun 29 May 2011, 06:19 Post subject:
|
|
i've used xev plenty of times, but it never occured to me to pipe it to filter the output. I've just scrooollllllllllled in the terminal. Very nice trick don570!
|
|
Back to top
|
|
 |
ASRI éducation

Joined: 09 May 2009 Posts: 1476 Location: France
|
Posted: Tue 05 Jul 2011, 20:31 Post subject:
|
|
| Dougal wrote: | | replace the "C-0x87" with "0x6F" (assuming your Print key is 111... I just googled "111 in hex".) |
Merci pour l'info.
|
|
Back to top
|
|
 |
|