geekhack

geekhack Community => Keyboards => Topic started by: c64 on Fri, 05 October 2012, 11:14:53

Title: NUMLOCK on keyboard and numeric pad not independent
Post by: c64 on Fri, 05 October 2012, 11:14:53
I am trying to figure out why my NUMLOCK on the keyboard and numeric pad is not independent.  I want the NUMLOCK enabled on my numeric keypad but not on my keyboard.

Any ideas?

Hardware:
Dell Precision T3500
GoldTouch V2 keyboard
Adesso mechanical numeric keypad

OS:
Windows 7 Pro 64bit
Title: .
Post by: esoomenona on Fri, 05 October 2012, 11:17:14
.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: The_Beast on Fri, 05 October 2012, 11:25:45
You computer sees the number and the keyboard as the same input device. There is a way around it using Autohotkey can a keyhook program that can tell the difference between keyboard input devices.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: alaricljs on Fri, 05 October 2012, 11:32:40
My understanding is that in Windows you cannot separate numlock status.  I know you can separate interpretation of USB HIDs in AHK, but that doesn't include numlock.

There are numpads that internally toggle numlock with every key stroke, and laptops have similar hardware methods to deal with numlock on/off for external vs on-board KBs.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: samwisekoi on Fri, 05 October 2012, 11:36:13
I am trying to figure out why my NUMLOCK on the keyboard and numeric pad is not independent.  I want the NUMLOCK enabled on my numeric keypad but not on my keyboard.

Any ideas?

Hardware:
Dell Precision T3500
GoldTouch V2 keyboard
Adesso mechanical numeric keypad

So, assuming you are using the Adesso with the GoldTouch, there are numlock keys on BOTH devices.  The one on the GoldTouch is intended to enable the embedded number pad and the one on the Adesso is intended to work the same way as the single NumLock key on a 104-key ANSI keyboard.  Is that the situation?

Assuming so, I ran a test using my Model M 104-key running under Linux.  This let me use the xev program to capture actual keycode values and ANSI mapping.

Here is what MY NumLock key sends:
(keycode 77 keysym 0xff7f, Num_Lock)

So there are two scenarios for you.

#1: Both devices are sending keycode 77, which your PC is mapping to ANSI Num_Lock.  That will be worst case, because both keys are fundamentally indistinguishable to the PC.  You'd have to put some sort of man-in-the-middle processor to resolve the conflict.

#2: Each key is sending a different keycode, but your PC is mapping them both to ANSI Num_Lock.  If that is the situation, you just need to determine the keycodes being passed and remap one of them.  (On a Linux machine, that would be simple with xev and xmodmap.  AutoHotKey under Windows?)

A caveat is that the keyboard processor in each device is likely doing something with the numlock BEFORE it send the keycodes to the PC.  For example, again on my setup:

With NumLock ON, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xffb7, KP_7)

With NumLock OFF, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xff95, KP_Home)

In that case, you'll have to find ALL of the keycodes sent by both devices under all four combinations of the two NumLock keys and remap them to what makes sense.  Again, on Linux it would be tedius, but could easily be done with xev and xmodmap.  On Windows or OS/X YMMV.

Does that help?

 - Ron | samwisekoi
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: alaricljs on Fri, 05 October 2012, 11:42:19
A caveat is that the keyboard processor in each device is likely doing something with the numlock BEFORE it send the keycodes to the PC.  For example, again on my setup:

With NumLock ON, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xffb7, KP_7)

With NumLock OFF, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xff95, KP_Home)

Notice the keycode is the same?  Nothing is going on, the keysym is different since it's modified by num_lock.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: c64 on Fri, 05 October 2012, 12:11:00
Both the GoldTouch and the Adesso have a NUMLOCK key.  If I press the NUMLOCK key on the Adesso, the LED comes on on both devices, press it again, goes off on both devices.  The same happens when pressing the NUMLOCK key on the Goldtouch.

Im not sure about the keycodes involved but it looks like Windows see both keys as coming from the same device. 

Here is my problem:  The Adesso needs the NUMLOCK key enabled in order to use the number keys.  If the NUMLOCK is enable though, my J,K,L,M,U,I,and O keys on the Goldtouch act as numbers.   So this requires me to press the NUMLOCK key each time I want to use the numeric pad, then press it again when I start using the Goldtouch.  Why would Adesso require a NUMLOCK key on a numeric keypad?  Its meant to input numbers!?
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: alaricljs on Fri, 05 October 2012, 12:30:19
Blame the specs.

With numlock OFF, you get the navigation.  ON, you get numbers... however, the numpads are all sending the same keycodes, it's how the OS interprets them that is differentiated by numlock.  The Goldtouch is using internal voodoo to send different keycodes depending on the numlock status.  This is the same voodoo lots of laptops do to have embedded numpads...

I mentioned it before, but there are numpads that treat the numlock locally.  You hit numlock, only the numpad numlock gets lit and the computer doesn't receive a code for it!  Then when you press the 5 key on the numpad it sends:  numlock on, KPAD_5, numlock off    To be clear, if numlock is off, it just sends KPAD_5 which is still the same key code as before, just no numlock.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: c64 on Fri, 05 October 2012, 13:05:36
Goldtouch tech supports says I should update my system BIOS.  I checked Dells website, and it looks like there are about 5 versions after the one I have.  None of the "Fixes" in the list state anything about the NUMLOCK.  I would rather not update the BIOS unless its necessary.  Does this sound logical that the BIOS update will fix this? 
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: samwisekoi on Fri, 05 October 2012, 13:06:53
A caveat is that the keyboard processor in each device is likely doing something with the numlock BEFORE it send the keycodes to the PC.  For example, again on my setup:

With NumLock ON, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xffb7, KP_7)

With NumLock OFF, pressing the 7 key on the 10-key pad yields this:
keycode 79 (keysym 0xff95, KP_Home)

Notice the keycode is the same?  Nothing is going on, the keysym is different since it's modified by num_lock.

Sadly, yes.  I saw that seconds after pressing [post].

<sigh>
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: c64 on Fri, 05 October 2012, 13:26:54
I updated my BIOS for the hell of it, didnt do diddly squat.  Seems like GoldTouch should have some software to disable the NUMLOCK key on the keyboard.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: davkol on Fri, 05 October 2012, 14:24:19
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: c64 on Fri, 05 October 2012, 14:44:38
You can remap keys on either keyboard using HID Macros (http://www.hidmacros.eu/). Of course, it's a workaround, but it should work.
'

Any tutorials on how to use this software?  I created a macro, device is my numpad 1 key, keyboard sequence 1.  Im not sure what to do next.
Title: Re: NUMLOCK on keyboard and numeric pad not independent
Post by: PelotaDeTrapo on Wed, 02 January 2019, 16:26:57
I had the same problem. The notebook takes the numpad as extended keyboard, and the numpad numlock modifie the embedded keyboard.
Then I used "KeyTweak" (easy and simple) and remap the numpad keys (only numbers).
It works perfect!!
(sorry for my english)