Author Topic: Model F AT keyboard with PuTTY to Linux box, emacs: numpad sends C-o sequences  (Read 1925 times)

0 Members and 1 Guest are viewing this topic.

Offline ed_avis

  • Thread Starter
  • Posts: 71
I normally use a Model M keyboard connected to the PS/2 keyboard port of a PC running Windows 7.  On that PC I run PuTTY to ssh to a Linux box, where I run emacs.  This all works fine but I recently switched to a Model F AT keyboard, connected with a simple adaptor to the same PS/2 keyboard port.  Now most things work, including the arrow and PgUp/PgDown keys on the numeric keypad in Windows apps.  But in my ssh session, the up-arrow key on the keypad doesn't send the usual escape sequence but 

Offline ed_avis

  • Thread Starter
  • Posts: 71
Re: Model F AT keyboard with PuTTY to Linux box, emacs: numpad sends ESC O x
« Reply #1 on: Mon, 27 January 2014, 08:40:18 »
Sorry hit submit too soon (related to the new keyboard having Ctrl in a different place!)  Corrected:

I normally use a Model M keyboard connected to the PS/2 keyboard port of a PC running Windows 7.  On that PC I run PuTTY to ssh to a Linux box, where I run emacs.  This all works fine but I recently switched to a Model F AT keyboard, connected with a simple adaptor to the same PS/2 keyboard port.  Now most things work, including the arrow and PgUp/PgDown keys on the numeric keypad in Windows apps.  But in my ssh session, the up-arrow key on the keypad doesn't send the usual escape sequence but ESC O x; other keypad keys also send ESC O sequences.

According to the PuTTY documentation, this may be something to do with 'VT400 mode' or other modes for the numeric keypad, but no matter what option I choose in the PuTTY config I still get these ESC O sequences.  Does anyone know what the trick is here?  It may be nothing to do with the Model F vs Model M - I would put the M back to check but it appears to have broken, which is why I made the switch.

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Dunno... could try setting keyboard layout to 84-key in Windows.

Offline ed_avis

  • Thread Starter
  • Posts: 71
Thanks for the suggestion - but how do I tell Windows it's an 84-key?  Under Text Services and Input Languages, I can change the keyboard, but I don't see anything like 'IBM AT 84-key' in the list.  Under Keyboard I see it listed as 'standard PS/2 keyboard' with no way to change it AFAICT.

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Not sure how to change it, it's the driver, normally "Standard 101/102-Key or Microsoft Natural PS/2 Keyboard". I remember choosing on install. So removing the driver and then going to Add Hardware should get that choice again. Bit of a hassle for something that may not work anyway, since the 84-key keyboard ought to just be a subset of a 101-key, and I can use the numpad cursors with PuTTY and Linux fine in bash (from a USB keyboard, but should be the same as far as PuTTY is concerned).

Is the problem only in emacs, or the same in bash, vi etc?

Offline ed_avis

  • Thread Starter
  • Posts: 71
Oddly, in bash the numpad keys give 789, etc, as if num lock were always on.  Only in emacs do they show as M-o blah.  In Windows things work fine, except that the numlock LED never lights up (this may be a hardware problem with my keyboard).  Perhaps running it through your converter would give better results - I'll need to buy the appropriate DIN socket.

Offline ed_avis

  • Thread Starter
  • Posts: 71
OK I think the Num Lock LED is part of the answer.  It doesn't work, so I thought Num Lock was off, but it was on.  I turned it off (checking in notepad.exe) and now setting the keypad to 'Xterm R6' in PuTTY works.

Offline ed_avis

  • Thread Starter
  • Posts: 71
Actually, none of the LEDs on the keyboard light up.  Does my PC not provide sufficient voltage or something weird like that?  The LEDs worked with a Model M.

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Aha! Cool! Maybe the LED board has come unplugged?

The only slight problem I've had with using numpad cursors is that shift+alt+cursor ends up doing the ascii code entry thing (i.e. same as alt+numpad with numlock on) in Windows. In my converter, I still need to add some code to allow different remaps or macros depending on lock state - it's certainly on the todo list. That will allow setting it up so that with numlock off the numpad produces codes for the inverted-T cursors and 6-key nav block above.

Offline ed_avis

  • Thread Starter
  • Posts: 71
I am a bit hesitant about opening up the keyboard since I have heard that Model Fs can be a pain to put back together.  As this is an AT Model F is it okay?

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
I haven't had any problems. The key thing, I think, is not to apply force to separate the front edge where the clips are. Treat it like a hinge and gently wiggle it free, and you should be OK.

Offline ed_avis

  • Thread Starter
  • Posts: 71
I plugged the keyboard into the PS/2 port on a different PC and the LEDs work.  So the problem was that the PC I used before (a Dell M6300 laptop with dock) didn't operate the LEDs.  This same Dell laptop is known to have problems with your converter; I guess the external keyboard support on laptops is not well tested.

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
But the LEDs worked with the Model M, no? All very strange!

I'm not sure if the 'bad' Dells still have a problem with my latest converter code - I did make some changes, but I don't know if anyone has tried them on a 'bad' Dell yet. Of course, if it's fixed, nobody will complain!

Offline ed_avis

  • Thread Starter
  • Posts: 71
Now you ask, I can't be sure the LEDs worked on the M, because I never use Caps Lock, Num Lock, or Scroll Lock ordinarily.  When I get a moment I'll check, and also check your latest converter code on that machine.  By the way, I read that you like to build the converter with a PS/2 keyboard socket and use adaptors for other keyboards.  Where do you get an adaptor from the 5-pin DIN terminal keyboards to PS/2... and is such an adaptor dangerous if you plug the terminal keyboard into an ordinary PS/2 port by mistake?

Offline Soarer

  • * Elevated Elder
  • Posts: 1918
  • Location: UK
Ahh, I see!

I had to make the terminal DIN to PS2 adapter (and the RJ45 to PS2 one). No danger since they are all the same nature of signals, just different codes.

No idea if the converter changes I made will work, since I have no idea why it didn't work before!