Jump to content

Can't set PS2 Keyboard to ISO


  • Please log in to reply
22 replies to this topic

#1
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male
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, 31 January 2007 - 08:12 PM.


#2
Paz

Paz

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 4 posts

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 ?

#3
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male
In fact, it worked - up to 10.4.7. It seems Apple bumped PS2ControllerVersion to 2 and I can't compile it from source now.

#4
mate

mate

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 2 posts
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

#5
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
No, "<" and ">" 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 "<" and ">" on other keys, I have a LatinoAmerican Keyboard and I have mapped "<" and ">" on "option ;" and "option ."

There are several keyboard layouts at the "Espaol" forum on the Other Language Section.

#6
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male
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)

#7
Macmat

Macmat

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
Hi,

I have same problem here.
My iso laptop keyboard is considered as ANSI by OS.
I have 10.4.8.
Could you find any solution for this?

Thank you!

#8
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male
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.

Attached Files



#9
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
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?

#10
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male

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.

#11
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
ya, I though so.

Is there a software on Windows/Linux/Other that display key codes?

#12
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
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?

#13
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male

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.

#14
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
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.

#15
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
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.

#16
macgirl

macgirl

    Stargate's Pharaoh

  • Retired
  • 7,615 posts
  • Gender:Female
  • Location:Mexico City
  • Interests:Techie gadgets
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.

#17
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male

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.

#18
yeye

yeye

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 292 posts
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

#19
jape

jape

    InsanelyMac Geek

  • Developers
  • 205 posts
  • Gender:Male
You'll need basic C++ knowledge and your OS X's version ApplePS2Keyboard source code...

#20
lemmy01

lemmy01

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 149 posts
  • Gender:Male
  • Location:germany
Where to get ApplePS2Keyboard source for leo?





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy