LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 07-28-2003, 01:33 AM   #1
Gantrep
Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 78

Rep: Reputation: 15
strings with xmodmap?


Ok, I have no problem using loadkeys to assign a string to a key, but I really want this in X. How do I use xmodmap to do this?

In other words,

loadkeys
string F12 = "foobar"
<ctrl-d>

Is cool, but

xmodmap -e "string F12 = .....?????

see the problem? How would I do this?
 
Old 07-28-2003, 11:39 AM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Did you do a man xmodmap?

keycode NUMBER = KEYSYMNAME ...
The list of keysyms is assigned to the indicated keycode (which
may be specified in decimal, hex or octal and can be determined
by running the xev program.


The problem is that xmodmap assigns pre-defined Key Symbol Names to keys specified by the keycode number.

The definitions for the keysyms are to be found in /usr/X11R6/include/X11/keysymdef.h

Now the question arises as to whether or not you actually need to have your F12 key defined to be FooBar for all X applications, or as I suspect just an X terminal emulator.

This can be done for Xterm by setting the appropriate application default resource.

From the xterm, manual page

ACTIONS
It is possible to rebind keys (or sequences of keys) to arbitrary
strings for input, by changing the translations for the vt100 or
tek4014 widgets.


Here is an example for the standard vt100 mode of xterm

XTerm.VT100.Translations: #override \n\
! <Key> Insert : string("\033[2~") \n\
! <Key> Home : string("\033[1~") \n\
! <Key> Prior : string("\033[5~") \n\
! <Key> Select : string("\033[3~") \n\
! <Key> End : string("\033[4~") \n\
! <Key> Next : string("\033[6~") \n\
! <Key> F1 : string("\033[11~") \n\
! <Key> F2 : string("\033[12~") \n\
! <Key> F3 : string("\033[13~") \n\
! <Key> F4 : string("\033[14~") \n\
! <Key> F5 : string("\033[15~") \n\
! <Key> F6 : string("\033[17~") \n\
! <Key> F7 : string("\033[18~") \n\
! <Key> F8 : string("\033[19~") \n\
! <Key> F9 : string("\033[20~") \n\
! <Key> F10 : string("\033[21~") \n\
! <Key> F11 : string("\033[23~") \n\
! <Key> F12 : string("\033[24~") \n

If you wish to do this for other X terminal emulators (aterm, eterm, rxvt) then please consult the corresponding man page for setting the appropriate resource.

Last edited by Corin; 07-28-2003 at 11:46 AM.
 
1 members found this post helpful.
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
xmodmap chrismiceli Linux - Software 2 06-29-2006 03:18 AM
how to find duplicate strings in vertical column of strings markhod Programming 7 11-02-2005 04:04 AM
xmodmap help pitt30 Slackware 11 01-14-2005 04:54 AM
xmodmap snt Linux - Software 0 11-15-2004 08:59 AM
xmodmap ntilde Mandriva 0 07-27-2004 01:28 PM


All times are GMT -5. The time now is 10:14 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration