Web Server forum
Back To The Forum Home!Search!Private Messaging System

This is Interesting: Free IT Magazines Now Free shipping to California  
Web Server Talk Web Server Talk > Unix and Linux reviews > Linux support forum > Linux Help > xmodmap help.




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    xmodmap help.  
Mark Healey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-07-07 12:17 PM


I have an IBM 84 key space saver keyboard.  It has numerals and
mathematical operators on the fore edges of some of the querty keys and
"Num Lock" on the fore edge of the back space key.  I assume that this
was so you could toggle number locking by chording the backspace key with
something and use the labeled querty keys as a numeric keypad.  I don't
think that this was done in hardware and there is no option for this
keyboard in any of the confituration programs.

I'd like to make one but can't figure out how to use xmodmap to do so.

What I'd like to do is set it up so that the right alt key chorded with
backspace toggles number locking.  Once I've done that I'd like to have
the "U" key input a 4, the "I" key input a 5, etc when number locking is
on.

How do I do this.


--





[ Post a follow-up to this message ]



    Re: xmodmap help.  
Dances With Crows


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-07-07 06:20 PM

Mark Healey staggered into the Black Sun and said:
> I have an IBM 84 key space saver keyboard.  It has "Num Lock" on the
> fore edge of the back space key.  I assume that this was so you could
> toggle number locking by chording the backspace key with something and
> use the labeled querty keys as a numeric keypad.  I don't think that
> this was done in hardware and there is no option for this keyboard in
> any of the configuration programs.

Fire up xev and take a look at the keycodes reported when you push
{various modifiers}+BkSpace.  IBM Thinkpads use a strange keycode for
NumLock; Shift+ScrollLock produces keycode 77, which you have to xmodmap
to NumLock.

> I'd like to make one but can't figure out how to use xmodmap to do so.
> What I'd like to do is set it up so that the right alt key chorded
> with backspace toggles number locking.

If something (shift or alt) together with backspace produces a keycode
different from the normal backspace keycode, all you should have to do
is find that keycode and do "xmodmap -e 'keycode NN = NumLock' ".  Once
you've figured that out, have something that runs at your WM/DE startup
execute that xmodmap command.

> Once I've done that I'd like to have the "U" key input a 4, the "I"
> key input a 5, etc when number locking is on.

This should happen automagically if the keyboard's behaving properly.
At least it did on all the Thinkpads with NumLock that I've had.

--
You have me mixed up with more creative ways of being stupid.
--MegaHAL, trained on random gibberish
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see





[ Post a follow-up to this message ]



    Re: xmodmap help.  
Mark Healey


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-08-07 06:26 AM

On Fri, 07 Sep 2007 16:19:00 +0000, Dances With Crows wrote:

> Mark Healey staggered into the Black Sun and said: 
>
> Fire up xev and take a look at the keycodes reported when you push
> {various modifiers}+BkSpace.  IBM Thinkpads use a strange keycode for
> NumLock; Shift+ScrollLock produces keycode 77, which you have to xmodmap
> to NumLock.
> 
>
> If something (shift or alt) together with backspace produces a keycode
> different from the normal backspace keycode, all you should have to do
> is find that keycode and do "xmodmap -e 'keycode NN = NumLock' ".  Once
> you've figured that out, have something that runs at your WM/DE startup
> execute that xmodmap command.

Here are the some of the relevant lines from -pke:

keycode  22 = BackSpace Terminate_Server

I happen to know that the Terminate_Server is sent when one hits Ctrl-Alt-
Backspace.

keycode  31 = i I iacute Iacute iacute Iacute

The iacute and Iacutes are sent then the I key is chorded with Alt Gr.

When you look at some of the keypad lines:

keycode  88 = KP_Down KP_2
keycode  77 = Num_Lock Pointer_EnableKeys

The two values in each line above are determined by the numlock state
(mod2).

Obviously the output of -pke doesn't make explicit whick keycode is sent
defined by which modifiers are relevant.
 
>
> This should happen automagically if the keyboard's behaving properly. At
> least it did on all the Thinkpads with NumLock that I've had.

This keyboard is 20 years old.  Laptop keyboards and new desktop space
savers do this by sending different scan codes for the relevant keys when
in numlock mode (0x16 and 0x96 when in numlock and 0x4b and 0xcb when not
(or the other way around, I forgot)).  Old keyboards don't do that so I
need to do it in software.

What I'd like to do is have Alt Gr-Backspace send a Num_Lock when numlock
is off and Pointer_Enable_Keys when numlock is on.

And then I'd like to have the numeric U key send a 4 or a KP_4 when
numlock is on and the normal values depending on the state of shift and
Alt Gr otherwise.


--
Mark Healey
marknews@healeyopolis.com





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:56 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register