overdue-scratch

Author Topic: [etc] KeyRemap4Macbook Patch for recognizing VooodooPS2  (Read 5989 times)

0 Members and 1 Guest are viewing this topic.

trip2me

  • Observer
  • Posts: 21
[etc] KeyRemap4Macbook Patch for recognizing VooodooPS2
« on: May 25, 2009, 02:41:50 AM »
Hi.
It's not a VPS2 thread.
But I think it is related with VPS2 users who want remap his or her PS/2 keyboard.

KeyRemap4Macbook intercepts a IOHIKeyboard instance. VoodooPS2Keyboard inherits IOHIKeyboard like IOHIDKeyboard. So I think it's possible to use with KeyRemap4Macbook.

Here is a patch.
It's just simple. Just add ioregistry name check routine on it.
I don't know whether PS2Mouse and PS2Trackpad work well.

Code: [Select]
diff -urN KeyRemap4MacBook-5.1.0 orig/src/core/kext/KeyRemap4MacBook.cpp KeyRemap4MacBook-5.1.0/src/core/kext/KeyRemap4MacBook.cpp
--- KeyRemap4MacBook-5.1.0 orig/src/core/kext/KeyRemap4MacBook.cpp      2008-05-21 23:34:04.000000000 +0900
+++ KeyRemap4MacBook-5.1.0/src/core/kext/KeyRemap4MacBook.cpp   2009-05-25 09:08:45.000000000 +0900
@@ -578,6 +578,7 @@
 
   // AppleADBKeyboard == PowerBook, IOHIKeyboard == MacBook, MacBook Pro, Mac mini, ...
   if (strcmp(name, "IOHIDKeyboard") == 0 ||
+      strcmp(name, "ApplePS2Keyboard") == 0 ||
       strcmp(name, "AppleADBKeyboard") == 0) {
     HookedKeyboard *p = new_hookedKeyboard();
     if (p) {
@@ -623,6 +624,8 @@
 
   // IOHIDPointing == External USB Mouse, AppleUSBGrIIITrackpad == MacBook Pro, AppleADBMouseType4 == PowerBook
   if (strcmp(name, "IOHIDPointing") == 0 ||
+      strcmp(name, "ApplePS2Mouse") == 0 ||
+      strcmp(name, "ApplePS2Trackpad") == 0 ||
       strcmp(name, "AppleUSBGrIIITrackpad") == 0 ||
       strcmp(name, "AppleADBMouseType4") == 0) {
     HookedPointing *p = new_hookedPointing();

Latest build version was splited two source code into keyboard part and pointing one. But it's a same way.

I attached patched official version and latest one.
If you have got any problem, report me please. : )
« Last Edit: May 28, 2009, 03:17:26 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