Solved

how to use .Xdefaults file for keymaps

Posted on 2006-06-24
4
428 Views
Last Modified: 2008-02-01
Hi,

In the xterm man pages I can see the following text towards the end.  It seems that X should insert the text (i.e. next, step, continue, etc.) whenever I press the F-key.  However, when I add this code to my .Xdefaults and then run "xdrb -merge .Xdefaults" I am not able to press the F-key.

In my config I changed the F-keys to something lower, such as F7, but it still did not work.

           *VT100.Translations: #override <Key>F13: keymap(dbx)
           *VT100.dbxKeymap.translations: \
                <Key>F14: keymap(None) \n\
                <Key>F17: string("next") string(0x0d) \n\
                <Key>F18: string("step") string(0x0d) \n\
                <Key>F19: string("continue") string(0x0d) \n\
                <Key>F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0)

Can someone please tell me how to enable this?  I would like to press the F-key for doing commands.

0
Comment
Question by:bryanlloydharris
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 16974562
Here is what happens when I press the F-key a few times.  It just types 8~ instead of typing the desired text.

$ 8~8~8~8~8~8~
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 350 total points
ID: 16974890
I found this particular issue rather annoying. I can get it to work in twm, but not in gnome or kde!...so I'm also missing something atm. You may wish to have a look at this package though, which appears to encompass everything:

http://www.shallowsky.com/software/crikey/

Which provides the funcrtionality you are after with instructions for different environments, and worked relatively easily for me.

(   (()
(`-' _\
 ''  ''

0
 
LVL 3

Author Comment

by:bryanlloydharris
ID: 16975092
Hi, I actually figured it out with great effort.  It's just that the X resources database is difficult for me to understand.

I was starting to wonder if I could send similar strings to firefox when I read your answer --- thanks for the tip!  I will probably end up throwing out the use of .Xdefaults and just stick with crikey if it works for me.  Have you had good experience with it?

Anyway, if you're curious, here is the final result of my efforts.  With the following code in .Xdefaults you must _first_ press F1 to "activate" the other lines of code --- at least that's my basic understanding.  Once you have pressed F1, you may press one of the other combos and its associated string will be inserted on the xterm CLI.

I thought it would be cool if I could type something like *firefox.Translations: to do a keymap in firefox but I'll just leave that in the back of my mind for later.  It also doesn't really seem worth looking up if that crikey program ends up working.

What I had to do to get it work was:
0) create the .Xdefaults file and put in the code
1) run "xrdb -merge .Xdefaults"
2) close my xterm
3) open a new xterm
4) press F1
5) then press one of the others and voila it worked.

*VT100.Translations: #override <Key>F1: keymap(function)
*VT100.functionKeymap.translations: \
    <Key>F2: string("some string here\n") \n\
    <Key>F3: string("another string here\n") \n\
    <Key>F4: string("and yet another string here\n") \n\

0
 
LVL 22

Expert Comment

by:pjedmond
ID: 16975826
Never used crikey before today - Was gradually ripping out my hair trying to get it to work and found this little utility (with reasonably clear instructions). Got what I wanted working in about 10 mins:) Thanks for your explaination - I can get it working on my system with the .Xdefaults now - but it's a bit fiddly....but then again, it's probably something that you'd normally only do once!

Many thanks for the points

(   (()
(`-' _\
 ''  ''
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question