Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 21 Dec 2014, 11:25
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Unable to bind Print key in openbox
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
lithpr


Joined: 10 Mar 2011
Posts: 186

PostPosted: 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
View user's profile Send_private_message 
pemasu


Joined: 08 Jul 2009
Posts: 5465
Location: Finland

PostPosted: 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
View user's profile Send_private_message 
lithpr


Joined: 10 Mar 2011
Posts: 186

PostPosted: 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 Smile 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 Wink

I would still love to hear from someone who managed to successfully use the Print key with rc.xml.
Back to top
View user's profile Send_private_message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: 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
View user's profile Send_private_message 
lithpr


Joined: 10 Mar 2011
Posts: 186

PostPosted: Thu 26 May 2011, 16:53    Post_subject:  

Dougal,

BOOYAH! <keybind key="0x6F"> did the trick.

Thank you very much!

Lithpr
Back to top
View user's profile Send_private_message 
DaveS


Joined: 09 Oct 2008
Posts: 3726
Location: UK

PostPosted: 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
View user's profile Send_private_message 
don570


Joined: 10 Mar 2010
Posts: 3437
Location: Ontario

PostPosted: 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
View user's profile Send_private_message 
Dougal


Joined: 19 Oct 2005
Posts: 2505
Location: Hell more grotesque than any medieval woodcut

PostPosted: 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
View user's profile Send_private_message 
lithpr


Joined: 10 Mar 2011
Posts: 186

PostPosted: 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
View user's profile Send_private_message 
ASRI éducation


Joined: 09 May 2009
Posts: 2648
Location: France

PostPosted: 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.
Wink
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0834s ][ Queries: 12 (0.0035s) ][ GZIP on ]