Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Several posts refer to Xmodmap as solution to remapping a key in Gnome terminal. Some of these posts refer to external documents. There is a manual of sorts for Xmodmap at http://www.xfree86.org/4.2.0/xmodmap.1.html
I wish to remap Control-y to "ESC-_". Running xev shows ESC is keycode 9, shift is keycode 50 and _ is keycode 20.
I have not run across how to map a set of keystrokes to a single key; only a single key to another single key.
Please tell me if this is possible. Could you give me an example? Is there a better program to use for this?
It turns out the referenced external manual is the same as running "man xmodmap". This man page references X(7), but it does not exist. Is there a man page for X-Window?
The information I sought regarding mapping a keystroke to a string (or a set of commands) is one of the functions in the utility loadkeys. man loadkeys will start you off. I intend to update thread with more specific instructions as I discover them.
man keymaps is the driving document to read. The strings section occurs near the end of that document and is limited to assigning strings (ie, multiple commands) per keystroke to function keys alone. In addition to normal PC function keys (F keys, eg, F1, F2, F3 ... F12), it is possible to give non-keyboard imprinted function keys (F13 ... F2xx) a string value to generate upon pressing.
This was not my intention. Instead I wished to re-assign a specific key, CONTROL-y, to generate the multibyte string, "ESCAPE-_". This is a common unix shell command to retrieve the last word of the previous command and insert it at the cursor position of the line being currently crafted. I got in the habit of using CONTROL-y as I had remapped it using an early version of Reflections software, a unix terminal emulator. Reflections had a neat and easy GUI that allowed you to assign any keyboard key to any arbitrary string, any Windows PC command (like copy or paste), any function (using a built in command language).
I would like any information you have as to what I could do for a similar experience. Whether available as a GUI or using the shell. Frankly, I was surprised Gnome Terminal did not have the ability to remap keys, but then I'm new to Linux. Thanks,
I was not able to remap a key as a script, which is what I finally decided I was trying to do. In fact, when that failed after all attempts, I tried to remap Control_y to an underscore. Although I can see from dumpkeys that was successful, I cannot get it to print when Control_y is pressed. Nothing prints!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.