overdue-scratch

Author Topic: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?  (Read 11986 times)

0 Members and 1 Guest are viewing this topic.

trip2me

  • Observer
  • Posts: 21
First of all, thanks for launching awesome PS/2 project.

In Korea, There are two keys to change language input source.
It is Korean/Engslish and Hanja( Korean to Chinese related letter ).
So each key's virtual ADB keycode has been defined by Apple.
The Korean/English keycode is 0x68, Hanja is 0x66.
Two of them have also PS/2 scan code. 0xF2, 0xF1.

I attached diff file.
So I wish you include my patch code to VoodooPS2Keyboard.

Sincerely.
« Last Edit: April 11, 2009, 02:44:06 PM by trip2me »
Let's be a realist, however, keep impossible dream in our mind. -Che Guevara
All good that I do or have done is from Allah, and only the mistakes have been mine.  -Malcolm X

mackerintel

  • VoodooLabs
  • Posts: 38
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #1 on: April 11, 2009, 02:51:42 PM »
Thank you for contributing to the project. Your patch looks fine to me, I'll apply it as soon as I have my building environment back into shape

dungbx

  • Entrant
  • Posts: 7
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #2 on: April 11, 2009, 07:13:36 PM »
How about Japanese keyboard?

nil

  • VoodooLabs
  • Posts: 15
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #3 on: April 12, 2009, 12:08:42 AM »
hey trip2me and dungbx,

attached is an updated kext according to trip2me's patch -- please try this and let us know!

thanks

ni|

mackerintel

  • VoodooLabs
  • Posts: 38
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #4 on: April 12, 2009, 12:17:15 AM »
hey trip2me and dungbx,

attached is an updated kext according to trip2me's patch -- please try this and let us know!

thanks

ni|

Thanks for applying the patch and supplying kext while my build system is offline. This patch will be included in the next release

nil

  • VoodooLabs
  • Posts: 15
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #5 on: April 12, 2009, 04:03:48 AM »
@mackerintel

np, sensei!  ;)

trip2me

  • Observer
  • Posts: 21
Actually LANG1/LANG2 keycode can be Kana, Eisu on OSX.
« Reply #6 on: April 12, 2009, 06:21:25 AM »
How about Japanese keyboard?

I'm sorry about not mentioning Japanese key.
Actually virtual ADB keycodes(which are 0x68, 0x66) is Kanakata and Eisu on Machintosh Janpanese keyboard layout. Apple has supported Japananese very well, but it hasn't Korean. These Korean special keys are borrowed from Japan.
So Kana makes same keycode of Korean/English, Eisu is same as Hanja.
I think these keys doesn't have side effect on US-standards keyboards.

By the way, there are another special keys for Japanase. (Zenkaku/Hankaku, Muhenkan...)
I saw some Japanese PS/2 109-keyboard on internet and googled virtual ADB code for another Janpanese related key. But I couldn't get more information.


P.S.
You can get more virtual ADB keycode information on latest Darwin's IOHIDFamily source code.
http://www.opensource.apple.com/darwinsource/10.5.6/IOHIDFamily-258.3
I attached it which has some more comments.
Comments are borrowed from MS's HID USB to PS/2 translation table
http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf

@mackerintel
Thanks for your supports.
« Last Edit: April 12, 2009, 06:42:59 AM by trip2me »
Let's be a realist, however, keep impossible dream in our mind. -Che Guevara
All good that I do or have done is from Allah, and only the mistakes have been mine.  -Malcolm X

dungbx

  • Entrant
  • Posts: 7
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #7 on: April 13, 2009, 03:18:14 AM »
The thing is Japanese keyboard layout is different with US, or even Korean.
For example, take a look at this:
http://static.benippon.com/shop/images/ELEC-BKBP-J109LG.jpg

at the key "2", shift-2 will produce ", not @

So is there any way to change this? diff patch doesnt seem to fix for me.

Best.
« Last Edit: April 13, 2009, 03:20:07 AM by dungbx »

mackerintel

  • VoodooLabs
  • Posts: 38
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #8 on: April 13, 2009, 12:31:32 PM »
The thing is Japanese keyboard layout is different with US, or even Korean.
For example, take a look at this:
http://static.benippon.com/shop/images/ELEC-BKBP-J109LG.jpg

at the key "2", shift-2 will produce ", not @

So is there any way to change this? diff patch doesnt seem to fix for me.

Best.
Change keyboard layout in System Preferences. The problem discussed here is different: dead keys on these keyboards

dungbx

  • Entrant
  • Posts: 7
Re: Could you include Lang1/Lang2 key patch into VoodooPS2Keyboard?
« Reply #9 on: April 13, 2009, 01:29:00 PM »
Opps. I'm sorry, since PS2Controller has never ever worked on my laptop, I dont really know.
Usually I have to use external USB keyboard and it's detected automatically.

I will try those keys when it works.
Thank you very much!
 :-*

trip2me

  • Observer
  • Posts: 21
some info.
« Reply #10 on: April 15, 2009, 06:49:14 PM »
Opps. I'm sorry, since PS2Controller has never ever worked on my laptop, I dont really know.
Usually I have to use external USB keyboard and it's detected automatically.

I will try those keys when it works.
Thank you very much!
 :-*

I don't know that why Kana and Eisu don't work, too.

I've looked at HIDFamily source code for a few days.
But my lack of knowledge, I can't find a reason.
And I don't have a Japanese keyboard and I don't know how to use Japanese Input system on OS X also.


During examining code, I've got some ideas.

1. PS2ToADBMap table needs to be updated for supporting some functionkeys and otherkeys such as media-key.
2. Info.plist has some registry keys for identifying specific locale Keyboard and more custom settings.
3. Using copied PS2ToADBMap is easy to remap the table by custom settings.
4. If we can't use special key with dispatchKeyboardEventWithScancode(), it's a nice try to use keyboardSpecialEvent()
5. Maybe Europe keyboard layout supports is needed. Because IOHIDKeyboard.cpp did same thing. It's USB version of VoodooPS2Keyboard without special keys.

It's recommended to reference below codes. There are latest open Darwin's IOHIDFamily-258.3 codes.

IOHiDKeyboard.cpp          : start(), dispatchKeyboardEvent(), deviceType()
IOHIKeyboard.cpp            : keyboardEvent(), keyboardSpecialEvent(), dispatchKeyboardEvent()
IOHIKeyboardMapper.cpp : parseKeyMapping(), postKeyboardSpecialEvent(), performF12Eject()
IOHIDConsumer.cpp         : dispatchConsumerEvent()
IOHIDEventService.cpp      : dispatchKeyboardEvent()
Cosmo_USB2ADB.c

to understand PS2ToADBMap structure, visit below website. It's old thing, but useful.
It help you read IOHIKeyboardMapper.cpp easily. and it is starting point of updating PS2ToADBMap.
http://www.xfree.org/current/dumpkeymap.1.html#sect7

Because I'm not good at programming, I hope some guru makes advance our projects with it.
sincerely.


P.S. just attached some code.
adapting some modification of 2,3,4,5
it's buggy test code so, just think it's a sample.


(updated) I update PS2ToADBMap from latest Cosmo_USB2ADB.c
It just add F16-F20 functionkey definition and media key suppport. such as NX_KEYTYPE_PLAY
Add Japanese PC keyboard supports. Just a few key mappings to Kana and Eisu.
« Last Edit: April 16, 2009, 07:24:28 PM by trip2me »
Let's be a realist, however, keep impossible dream in our mind. -Che Guevara
All good that I do or have done is from Allah, and only the mistakes have been mine.  -Malcolm X