[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:X Resource Question



It works now, and is wonderful!  Bellow is the synopsis for anyone else
interested.

>> My "keymap" mod looks like:
>> 
>> *VT100*translations:    #override  <Key>F13: keymap(dbx) \n\
>>         <Key>F1                   :     string("Hello You Stupid World") \n\
>>         <Key>F2                   :     string(0x1b) string("OQ") \n\
>>         <Key>F3                   :     string(0x1b) string("OR") \n\
>>         <Key>F4                   :     string(0x1b) string("OS") \n\
>>         <Key>F5                   :     string(0x1b) string("OT") \n\
>You might have to lose the last backslash.

This was just an except not the whole thing.

>> 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 ")
>You might need a "\n" after the ("print ") -- NOT "\n\"

Yes, it look that way.

>Dumb question, but how are you getting F13 thru F20?

In my /etc/X11/xdm/Xsetup I have the following commands:

/usr/X11R6/bin/xmodmap -e "keysym KP_Divide = slash"
/usr/X11R6/bin/xmodmap -e "keysym KP_Decimal = period"
/usr/X11R6/bin/xmodmap -e "keysym KP_Add = plus"
/usr/X11R6/bin/xmodmap -e "keysym KP_Subtract = minus"
/usr/X11R6/bin/xmodmap -e "keysym KP_Multiply = asterisk"
/usr/X11R6/bin/xmodmap -e "keysym KP_Enter = Return"
/usr/X11R6/bin/xmodmap -e "keysym KP_0 = 0x30"
/usr/X11R6/bin/xmodmap -e "keysym KP_1 = 1 F13"
/usr/X11R6/bin/xmodmap -e "keysym KP_2 = 2 F14"
/usr/X11R6/bin/xmodmap -e "keysym KP_3 = 3 F15"
/usr/X11R6/bin/xmodmap -e "keysym KP_4 = 4 F16"
/usr/X11R6/bin/xmodmap -e "keysym KP_5 = 5 F17"
/usr/X11R6/bin/xmodmap -e "keysym KP_6 = 6 F18"
/usr/X11R6/bin/xmodmap -e "keysym KP_7 = 7 F19"
/usr/X11R6/bin/xmodmap -e "keysym KP_8 = 8 F20"
/usr/X11R6/bin/xmodmap -e "keysym KP_9 = 9 F21"

Which both puts my keypad in permament Num_Lock mode, and maps
Shift KP_1 - KP_9 to F13 through F21.  Very clever on my part.

>In your config, you have to press F13 to activate the
>keymap before the other function keys work.
>(you did that, right?)

Nope,  didn't understand that part.

>Here's part of my XTerm file:
>!------------------------------------------------
>*VT100.dbxKeymap.translations: \
>     <Key>F9: keymap(None) \n\
>     <Key>F8: string("ls") string(0x0d) \n\
>     <Key>F7: string("KKKKKKKKKK") \n\
>     <Key>F6: string("tttttttttt") \n\
>     <Key>F2: string("Kkljztqj") \n\
>     <Key>F1: string("y\n") \n
>XTerm.vt100.translations: #override\n\
> <Key>F10: keymap(dbx)\n
>!------------------------------------------------
>F10 activates my keys, F9 turns them off.

I've put the following lines in /usr/lib/X11/app-defaults/XTerm:

XTerm.vt100.translations:       #override \n\
        Ctrl<Key>Home             :     string(0x1b) string("Os") \n\
        Ctrl<Key>End              :     string(0x1d) \n\
        Ctrl<Key>Prior            :     string(0x1b) string("Oq") \n\
        Ctrl<Key>Next             :     string(0x1b) string("Or") \n\
        Ctrl<Key>BackSpace        :     string(0x1b) string("On") \n\
        Ctrl<Key>F1               :     string(0x1b) string("OP") \n\
        Ctrl<Key>F2               :     string(0x1b) string("OQ") \n\
  . . . 
        Shift<Key>F5              :     keymap(user1) \n\    <<<<<
        Shift<Key>F6              :     keymap(user2) \n\    <<<<< Added
        Shift<Key>F7              :     keymap(user3) \n\    <<<<<  these
        Shift<Key>F8              :     keymap(user4) \n\    <<<<<    lines
  . . .
        ! @Num_Lock Ctrl        <Btn5Down>:     scroll-forw(1,halfpage) \n\
                                <Btn5Down>:     scroll-forw(5,line)

<<<<<<End of usr/lib/X11/app-defaults/XTerm>

And by putting the following in my ~/.Xdefaults file I have four
selectable private key maps (with a total of 48 keys):


*VT100.user1Keymap.translations: \
	Shift<Key>F5:	keymap(None) \n\
	Meta<Key>F1:	string("Hot Key f1-1") \n\
        Meta<Key>F2:	string("Hot Key f2-1") \n\
        Meta<Key>F3:	string("Hot Key f3-1") \n\
        Meta<Key>F4:	string("Hot Key f4-1") \n\
        Meta<Key>F5:	string("Hot Key f5-1") \n\
        Meta<Key>F6:	string("Hot Key f6-1") \n\
        Meta<Key>F7:	string("Hot Key f7-1") \n\
        Meta<Key>F8:	string("Hot Key f8-1") \n\
        Meta<Key>F9:	string("Hot Key f9-1") \n\
        Meta<Key>F10:	string("Hot Key f10-1") \n\
        Meta<Key>F11:	string("Hot Key f11-1") \n\
        Meta<Key>F12:	string("Hot Key f12-1") \n

*VT100.user2Keymap.translations: \
        Shift<Key>F6:   keymap(None) \n\
        Meta<Key>F1:    string("Hot Key f1-2") \n\
        Meta<Key>F2:    string("Hot Key f2-2") \n\
        Meta<Key>F3:    string("Hot Key f3-2") \n\
        Meta<Key>F4:    string("Hot Key f4-2") \n\
        Meta<Key>F5:    string("Hot Key f5-2") \n\
        Meta<Key>F6:    string("Hot Key f6-2") \n\
        Meta<Key>F7:    string("Hot Key f7-2") \n\
        Meta<Key>F8:    string("Hot Key f8-2") \n\
        Meta<Key>F9:    string("Hot Key f9-2") \n\
        Meta<Key>F10:   string("Hot Key f10-2") \n\
        Meta<Key>F11:   string("Hot Key f11-2") \n\
        Meta<Key>F12:   string("Hot Key f12-2") \n

*VT100.user3Keymap.translations: \
        Shift<Key>F7:   keymap(None) \n\
        Meta<Key>F1:    string("Hot Key f1-3") \n\
        Meta<Key>F2:    string("Hot Key f2-3") \n\
        Meta<Key>F3:    string("Hot Key f3-3") \n\
        Meta<Key>F4:    string("Hot Key f4-3") \n\
        Meta<Key>F5:    string("Hot Key f5-3") \n\
        Meta<Key>F6:    string("Hot Key f6-3") \n\
        Meta<Key>F7:    string("Hot Key f7-3") \n\
        Meta<Key>F8:    string("Hot Key f8-3") \n\
        Meta<Key>F9:    string("Hot Key f9-3") \n\
        Meta<Key>F10:   string("Hot Key f10-3") \n\
        Meta<Key>F11:   string("Hot Key f11-3") \n\
        Meta<Key>F12:   string("Hot Key f12-3") \n

*VT100.user4Keymap.translations: \
        Shift<Key>F8:   keymap(None) \n\
        Meta<Key>F1:    string("Hot Key f1-4") \n\
        Meta<Key>F2:    string("Hot Key f2-4") \n\
        Meta<Key>F3:    string("Hot Key f3-4") \n\
        Meta<Key>F4:    string("Hot Key f4-4") \n\
        Meta<Key>F5:    string("Hot Key f5-4") \n\
        Meta<Key>F6:    string("Hot Key f6-4") \n\
        Meta<Key>F7:    string("Hot Key f7-4") \n\
        Meta<Key>F8:    string("Hot Key f8-4") \n\
        Meta<Key>F9:    string("Hot Key f9-4") \n\
        Meta<Key>F10:   string("Hot Key f10-4") \n\
        Meta<Key>F11:   string("Hot Key f11-4") \n\
        Meta<Key>F12:   string("Hot Key f12-4") \n

Which are turned on with Shift F5 thorugh Shift F8 or completely
toggled off by pressing the same key again,  or switched to another map.

Now all I have to do it whip up a Tcl/TK script so my users can easy enter
in what they want in their private keys maps.