Jump to content

Can't set PS2 Keyboard to ISO


jape
 Share

23 posts in this topic

Recommended Posts

From the keyboard layout image I noticed that I'm missing a key that is present on my keyboard, right to the left shift. I'm not meaning that a key is mismapped to another key, I say that that key is unusable. Ukelele doesn't show its code nor can remap it.

 

I think that key is '<' on most european keyboards.

 

I've been reading about how OS X keyboard input works and ADB and all that, and found that I should set the Keyboard Type to ISO (instead of default ANSI) using Preferences -> Keyboard Wizard. However, the Keyboard Wizard does not appear at all when using PS2 keyboard.

 

By reading the ApplePS2Keyboard source I found that it defaults Keyboard Type to APPLEPS2KEYBOARD_DEVICE_TYPE, value = 0x1b. This is weird. The USB kext defaults the keyboard to kgestUSBUnknownANSIkd, value = 3 .

 

As soon as I get my hands on new XCode version I'll try to modify it and post the results, but It amazes me that I've found (other than a portuguese thread on this forum) virtually NO discussion about the impossibility! to write a backslash character on, for example, a French keyboard (as it gets remapped to '<' on the wrong key).

 

Edit: Do not think this is as simple as switching input methods on International panel -- it does not work. The '<' keycode is NOT correctly mapped at a ADB level on ANY ISO PS2 keyboard. Or at least that seems to.

Edited by jape
Link to comment
Share on other sites

  • 7 months later...
Edit: Do not think this is as simple as switching input methods on International panel -- it does not work. The '<' keycode is NOT correctly mapped at a ADB level on ANY ISO PS2 keyboard. Or at least that seems to.

Hi,

 

I have the same problem. I tried different french layouts proposed here in the forum and I finally found one that is good, but without the "<" ">" key support.

You can press it, it does nothing. Ukele didn't solved my problem neither.

Did you succeeded with Xcode ?

Link to comment
Share on other sites

  • 2 months later...

Hi, i have same problem for my build-in iso laptop keyboard. i have a thinkpad r50. internal keyboard and mouse works fine but os x thinks my keyboard is ansi instead of iso. therefore one key is missing from my keyboard. the same as yours "<" key between "left shift" and "z".

 

any progress on your work? any luck to work it under 10.4.8

Link to comment
Share on other sites

No, "" are not detected on PS/2, you could buy an USB to PS/2 adapter in order to make the OS believe you have an USB Keyboard so those keys could work.

 

Also you can try some keyboard layouts that map "" on other keys, I have a LatinoAmerican Keyboard and I have mapped "" on "option ;" and "option ."

 

There are several keyboard layouts at the "Español" forum on the Other Language Section.

Link to comment
Share on other sites

Hi! In fact I managed to recompile ApplePS2Controller 2.0.0 (actually I did it just a few weeks after my previous post), and then proceeded to put the changes in again:

 

- kgestUSBUnknownANSIkd as the default keyb type (so that no "Unknown keyboard type" assistant shows up everytime I boot up)

- mapping the <> key to an empty ADB -- then remap it with ukelele

- mapping the multimedia keys to empty ADB codes! then I used butler to remap those keys (even thought butler is not able to tell me what key I just pressed -- actually he says "empty key"-- it works indeed!) to iTunes functions.

 

Problem with the patch is that it's mostly hardcoded to the MS Multimedia Keyb. , but the <> key should work. Next time I boot into OS X I will try to post patch files to the 2.0.0 source. (I'm running 10.4.8)

Link to comment
Share on other sites

  • 3 months later...

I forgot about this. I'm attaching the patch I use; however, remember I'm using a MS Multimedia Keyboard so you may need to change a few keys.

 

Nevertheless, if your problem is _only_ that you can't set the keyboard to ISO, then you only need the first 12 lines of the patch.

 

I won't distribute patched source.

ApplePS2Controller.diff.txt

Link to comment
Share on other sites

I compile the ApplePS2Keyboard.kext with your diff, then made a few mods, because I have a Latinamerican Spanish keyboard that is slightly differnet from the Spanish (european).

 

On media keys, only next track works, so How can I know whick keycodes are for my media keys?

Link to comment
Share on other sites

On media keys, only next track works, so How can I know whick keycodes are for my media keys?

Weird. I read the ones I use from a document I found online. I though at least the multimedia ones would be standard.

Link to comment
Share on other sites

Well keycodes are OK, I tested with an USB/PS2 MS Multimedia keyboard

 

On USB connector the media buttons of the MS KB work, I will try today if it work with the PS2 connector.

 

Is possible that the ADB mappings does not suport those keycodes?

Link to comment
Share on other sites

Is possible that the ADB mappings does not suport those keycodes?

Problem is that there are very few ADB keys available for "custom use". That's the reason I've not mapped some of the MS Keyboard Keys (like My Music or My Pictures), because there's physically no Apple Keyboard key I could map those to. Other than that, the mappings are arbitrary -- since I use Butler, it does not matter what ADB key I map the PS2 key to: Butler will allow you to use any.

 

If you want to have a look at your keyboard extended keys, you can uncomment the following line

//IOLog("%s: Unknown extended scan code: 0x%x\n", getName(), scanCode);

that's on ApplePS2Keyboard/ApplePS2Keyboard.cpp around line 410. It will show unknown PS2 "extended" scan codes on the kernel log. Then you should replace the keycodes on the ApplePS2Keyboard.cpp file.

 

case 0x10: keyCode = 0x77; break;		//E010 = prev track

this maps extended PS2 keycode 0x10 to PS2_ADB array index 0x77, which itself maps that to an ADB key. Ugly, but that's how the ApplePS2Keyboard driver works.

If you can find the extended keycode for your prev track key, you should replace 0x10 with it.

 

USB keyboards can map more keys because they seem to use the HID subsystem directly (as Bluetooth keyboards do), which doesn't seem to be constrained by the small ADB key set.

 

Sorry for the slow answers, I'm not using OS X much lately.

Link to comment
Share on other sites

Don't worry Jape.

 

Yesterday finally did the testing with the MS multimedia PS2 KB, as my Laptop Keyboard only Next Track button works.

 

I will try with Butler and see what happens, thanks for all your efforts.

Link to comment
Share on other sites

Butler helped, I get Previous, play/pause and Next keys for iTunes. It does not recognize Stop key tho.

 

Fortunatelly the Remote control of my lappy is somehow linked to the keyboard so thos keys also work with the remote control.

Link to comment
Share on other sites

I want to report that I also mapped "Stop" key succesfully, in your diif is mapped to 0x3f bt that is Fn key of PowerBooks, so Butler does not detect, instead of 0x3f I used 0x4f and now Butler detect the "Stop" key as F18.

 

Also in Butler I mapped the "Stop" key to a combination of keystrokes, because in iTunes there is no really a stop, so a compination of "space" and "Command" and "Left" keys makes the Stop in iTunes.

Link to comment
Share on other sites

Also in Butler I mapped the "Stop" key to a combination of keystrokes, because in iTunes there is no really a stop, so a compination of "space" and "Command" and "Left" keys makes the Stop in iTunes.

Thanks for the tip. I did not even try the Stop key.

Link to comment
Share on other sites

  • 1 month later...

Hi Jape,

How do you do to edit the kext or whatever inside. Could you precise which files are you editing and with which software

What I want to do is to map F18 key (STOP key for Dell laptop) to ESCAPE key

 

Thanks for your help

Link to comment
Share on other sites

  • 1 month later...
  • 9 months later...

I'm using the last version that's on opensource.apple.com (the one of 10.4.3) (PS2Controller v.8, PS2Keyboard v.9, PS2Mouse v.10 and PS2Trackpad v.9, i get a 404 Not found error when trying to acces the v.9,v,10,v.11 and v.10 versions) and i'm trying to implement multimedia codes:

 

0xe1 0x1d 0x45 0xe1 0x9d 0xc5 PAUSE

 

0x1d 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 0x9d INTER

 

0xe0 0x2a 0xe0 0x37 0xe0 0xaa 0xe0 0xb7 PET SIS

0xe0 0x2a 0xe0 0x37 0xe0 0xaa 0xe0 0xb7 IMPR PA

 

As you can see Pause and Interrruption have the same identifier (0x45) i'm looking how to get them both apart (cuz i get pause mapped to f15 but inter doens't get mapped).

 

 

 

The other two... well i can't get it! Two keys have the same raw code... i know that pet sis (sys req) is deprecated but at least it should map both codes to the same key... it doesn't. I get Impr Pa (Print Scrn) mapped to Ctrl+Shift+3 then F13 (First does Ctrl.... and then F13). Well i think i've solved that by changing ctrl to Command and anulating the F13 throw.

 

Anyway... i'd like to know how to change the first group, i think the second group will be impossible to map.

 

 

 

Any help is appreciated :(.

 

PD: Here's the raw codes i got from linux

 

kb mode was UNICODE

[ if you are trying this under X, it might not work

since the X server is also reading /dev/console ]

 

press any key (program terminates 10s after last keypress)...

0x3b 0xbb F1

0x3c 0xbc F2

0x3d 0xbd F3

0x3e 0xbe F4

0x3f 0xbf F5

0x40 0xc0 F6

0x41 0xc1 F7

0x42 0xc2 F8

0x43 0xc3 F9

0x44 0xc4 F10

0x57 0xd7 F11

0x58 0xd8 F12

0x46 0xc6 BLOQ DESPL / DESPL

0xe1 0x1d 0x45 0xe1 0x9d 0xc5 PAUSE

0xe0 0x52 0xe0 0xd2 INS

0xe0 0x53 0xe0 0xd3 SUPR

 

WITH FN KEY (INVERSE ORDER)

0xe0 0x2a 0xe0 0x37 0xe0 0xaa 0xe0 0xb7 PET SIS / SYS REQ (FN + F1)

0xe0 0x2a 0xe0 0x37 0xe0 0xaa 0xe0 0xb7 IMPR PA / PRINT SCRN

0x1d 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 0x9d INTER

0x45 0xc5 BLQ NUM

0xe0 0x30 0xe0 0xb0 0xe0 0x30 0xe0 0xb0 SOUND UP

0xe0 0x2e 0xe0 0xae 0xe0 0x2e 0xe0 0xae SOUND DOWN

0xe0 0x20 0xe0 0xa0 SOUND MUTE

0xe0 0x54 0xe0 0xd4 BRIGHTNESS UP

0xe0 0x4c 0xe0 0xcc BRIGHTNESS DOWN

0xe0 0x12 0xe0 0x92 LOCK

0xe0 0x5f 0xe0 0xdf SLEEP

0xe0 0x56 0xe0 0xd6 WIDESCREEN

0xe0 0x32 0xe0 0xb2 BROWSER

0x1d 0x19 0x99 0x9d PRINT

0xe0 0x75 0xe0 0xf5 HELP (FN + F1)

0xe0 0x5d 0xe0 0xdd APPLICATION

 

I'm using the integrated keyboard of a Compaq 6720s (Europe). Also, i've though on calling directly to AppleBacklight to reduce screen brightness instead of mapping both keys to empty ones, due to the lack of empty keys.

Link to comment
Share on other sites

Plus i've got these scancodes from the console:

 

 

0x5b 0x5b 0x3d = Fn + f3

0x3e = Fn + F4

0x40 = Fn + F6

0x54 0x54 = Sys Req

0x70 0x2a 0x5 = Impr Pant

0x1d 0x1d = Left Ctrl (Interrupt)

0x1d 0x2e 0x1d 0x2e = Pause

0x46 = despl

0x45 = bloq num

Link to comment
Share on other sites

 Share

×
×
  • Create New...