LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-02-2012, 09:19 AM   #1
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Rep: Reputation: 35
ncmpcpp key bindings - where do these decimal values come from?


In ncmpcpp's "keys" config file, it says "keys can be defined with a character or a decimal value", and the defaults of some of these decimal values seem to be listed(and available to be altered) in the same file, like so:

#key_page_up = 339
#key_page_down = 338
#key_home = 262
#key_end = 360
#key_space = 32
#key_enter = 10
#key_delete = 330

At least one key though (backspace), doesn't seem to be expressly defined, but it is still bound using a decimal value (it's either 263 or 127, going by ncmpcpp's Help page and the "key_go_to_parent_dir" bind) in the keys file.

Where do these values come from? They don't correspond to anything reported in xev. Is there a list of these values somewhere I can consult to find out the decimal value for the Pause/Break key? Or is there a way I can define a value for the Pause/Break key myself?

I know I should just resign myself to using the "p" key, but I use my LIRC remote more often than not and when I use the keyboard I keep forgetting I've added the lowercase p as a secondary bind so I don't have to press Shift+P, and then I go and open up the keys file and go "oh yeah I did that already 3 months ago" and then I go off on a configuration tangent trying to figure out where these decimal values come from so I can just set the damn Pause key to the pause function but I never get any closer to a solution so here I am hoping someone else knows the answer.

Last edited by lurko; 05-02-2012 at 09:22 AM.
 
Old 05-12-2012, 02:19 AM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
Hi lurko,

as far as I know the xmodmap utility is used to modify keybindings. You should read the manpage for xmodmap and find out, if there's the information you're looking for.

Another point is: ncurses (where ncmpcpp belongs to) isn't a librarie for the X-window-system but runs in the terminal. So I think that tools like xmodmap or xev don't have anything to do with this library. You should check the settings for your terminal, these maybe different if your running X-window or not.

Markus
 
Old 05-18-2012, 12:14 AM   #3
lurko
Member
 
Registered: Jun 2006
Location: Ontario, Canada
Distribution: Debian
Posts: 448

Original Poster
Rep: Reputation: 35
Thanks for the reply markush. At first I just dismissed using xbindkeys out of hand because I figured it would mean binding the pause key to another key on my keyboard, and because what I thought I really wanted was to have the pause key only do something when I was on the virtual desktop I have reserved for ncmpcpp.

Your point about xev sent me on a new tangent of trying to discover key values though, and quite quickly I thought I'd come across the answer, which was that the pause key had a value of "119" (which can been seen with the "dumpkeys" command). Unfortunately sticking that in ncmpcpp's keys config file still didn't make the Pause/Break do anything in ncmpcpp. Then I spent some time trying to get what "showkey -s" showed for the pause key into the "setkeycodes" command, but to no avail probably due to the fact that Pause/Break is a special key and throws up a different type of scancode than every other key. I supose that's why it's apparently not bindable in ncmpcpp in the first place.

However! In trying to figure out how to use setkeycodes for the pause key, I came across a page describing how xbindkeys will show you the codes it uses for special keys, using the "xbindkeys -k" command, and that particular example was using the "mpc toggle" command which also happens to be the exact command I bind to my LIRC remote for doing pause/unpause in ncmpcpp/mpd. And then it finally dawned on me that I should just use xbindkeys to bind the Pause/Break key to that mpc command instead of trying to bother with ncmpcpp's binds at all. And I suppose this way is even a little bit better because I can now toggle ncmpcpp's pause state without even having ncmpcpp's window/terminal/desktop focused, which when I think about is probably what I should have been trying to achieve in the first place anyway. D'oh!

Thanks again markush, now I just wait and see if I don't soon come across some obscure function I can no longer make use of when my Pause is bound this way....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
X key-bindings problem arnuld Linux - General 3 05-31-2008 10:15 AM
Compare Decimal Values rbautch Linux - General 10 04-22-2008 04:11 AM
awk/nawk returning decimal values? moutaye Linux - General 6 03-25-2008 05:16 PM
key bindings TomalakBORG Linux - General 4 05-02-2005 09:27 AM
Key Bindings rmanocha Linux - Newbie 2 10-22-2003 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration