Re: getting at the raw keycodes for a USB keyboard
I have a similar problem, only instead of a japanese keyboard, I am using my sun type 6 usb keyboard so that I can kvm my mac and my sun server. All of the extra keys (row of ten: stop, props, again, etc.) are mapping to an equivalent ADB code of 'a' or something equally useless as well. I am seriously thinking about modifying the keyboard extension, but I can't do that without the raw usb keycodes as was noted previously. I grab the sources, and after a bit of wrangling I got the USB keyboard to compile. I uncomment the extant kprintf() statements, and try the new driver only then realizing I have no idea how to get to the output. I do some searching, and discover that I should also be able to use the kernel printf() or log() function calls to get the logging somewhere I know about, but I have been completely unsuccessful on getting these to compile in. I can seem to figure out which headers I should use, and what if any changes I need to make so that everything links and builds nicely. The farthest that I have gotten is to install the debugging version of the usb kernel extension, but I was still not able to figure out how to get the keycodes from this. This and the development usb sdk might fix your problems compiling in the log functions. I haven't spent too much time looking at what they contain but I think that these might do the trick for you. The debugging extensions/sdks for each version of mac os x are available here: http://developer.apple.com/hardware/usb/usbloggers.htm Additionally if you just want the adb codes, ascii codes, and keyboard ref numbers, you can use the asynckeys utility available on macupdate. Just a warning though, that it stopped working for me after I installed the debugging version of the usb kext. http://www.macupdate.com/info.php/id/5409 Finally I was wondering if anyone has a more general solution that does not involve hacking the apple usb extension. I am assuming that I am not the first unix developer who has plugged their usb sun keyboards into their mac. Is there any more general driver that allows the configuration of additional keys on a keyboard? Has any stubborn solaris developer already hacked a darwin driver to get the full functionality out of their familiar keyboard? I am clearly a newbie at writing device drivers and any other ideas would be more than welcome. Jason Orcutt ------------------------------------------------------------ Electrical Engineering/Applied Physics School of Engineering and Applied Science Columbia University ------------------------------------------------------------ On Monday, October 20, 2003, at 11:19 PM, Matt Doughty wrote: Ok, I have been banging my head against this, and maybe I just don't have the right perspective for what I want to do. I have a Japanese USB keyboard that is getting some of its keycodes squashed in the USB to AKB keycode conversion. this means that a number of keys are all either dead or mapping to AKB code for 'a'. I figure no problem, I will just compile a USB keyboard driver that logs the raw keycodes somewhere so I can fix the AKB lookup table. I grab the sources, and after a bit of wrangling I got the USB keyboard to compile. I uncomment the extant kprintf() statements, and try the new driver only then realizing I have no idea how to get to the output. I do some searching, and discover that I should also be able to use the kernel printf() or log() function calls to get the logging somewhere I know about, but I have been completely unsuccessful on getting these to compile in. I can seem to figure out which headers I should use, and what if any changes I need to make so that everything links and builds nicely. I'm sure this is extremely simple, but I just can't figure out where I should be looking and what the canonical/best way to go about getting the information I want is. I'm not even sure if I should be trying to replace to keyboard driver to get the support I am after or if there is a better way to fix my issues. Any help would be really appreciated. --Matt _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored. _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Jason Orcutt