Solved

how to use .Xdefaults file for keymaps

Posted on 2006-06-24
4
411 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
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now