LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
LinkBack Search this Thread
Old 05-23-2011, 03:56 AM   #1
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 5 & 6
Posts: 65

Rep: Reputation: 0
Centos 5.6, Gnome terminal, Xmodmap: remap multiple keystrokes?


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?

Thanks,
 
Old 05-23-2011, 09:00 AM   #2
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 5 & 6
Posts: 65

Original Poster
Rep: Reputation: 0
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?
 
Old 05-23-2011, 09:43 AM   #3
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 5 & 6
Posts: 65

Original Poster
Rep: Reputation: 0
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.
 
Old 06-02-2011, 11:07 PM   #4
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 5 & 6
Posts: 65

Original Poster
Rep: Reputation: 0
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,
 
Old 06-09-2011, 08:02 AM   #5
needsleep
Member
 
Registered: Apr 2011
Location: Minneapolis
Distribution: CentOS 5 & 6
Posts: 65

Original Poster
Rep: Reputation: 0
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!

On another search for keyboard mapping, I ran into,
http://www.linuxquestions.org/questi...apping-861204/
which says this needs to be done with c native library.

So now I need to learn how to run a c program in Linux.
 
  


Reply

Tags
centos5, gnome, remapping, xmodmap


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Gnome terminal 2.1.0, centos 5 - how to 'find' text listed on terminal screen linuxquestions_forum_use Linux - Newbie 2 12-21-2010 08:35 PM
xmodmap for multiple values malo_umoran Slackware 3 03-27-2005 09:39 AM
Desperately need to remap keys in Gnome basemodel Linux - Software 2 03-30-2004 11:50 AM
Multiple keystrokes in UT2003... Thermodynamic Linux - Games 1 01-26-2004 07:30 PM
Second Terminal Keystrokes Guinney Linux - Newbie 2 11-29-2002 08:18 PM


All times are GMT -5. The time now is 01:05 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration