Lefora Free Forum
Loading
858 views

Convert Virtual Key Code to USB Key code

Page 1
1–4
rookie - member
6 posts


Hi,

I'm trying to use Windows system remotely from Mac. For that I'm trying to convert Mac virtual key code to USB key code. For example, Virtual key code for 'Enter key' is 36 (apple extended keyboard and USB Key code is 40 and  scan code is 28.

I got Mac virtual key using CGEventTapCreate API. is there any API to convert virtual key code to USB or virtual key code to Scan code?

Thanks in advance.

?
288 posts

Gosh, I don't know.  I use Microsoft Remote Desktop Connection (RDC) to remote my Windows box. The preference panel has a "keyboard" table with which you define the key mapping.  I also use VMware Fusion to run Windows in a virtual machine on the Mac, and again there is a keyboard panel somewhere in the preferences.

Could you explain a little more about your environment.  Is this a cocoa related issue?  Are you writing a VNC client or something?

__________________
rookie - member
6 posts


Yes. I'm working on VNC client. I don't think there is API to convert virtual key code to Scan code or USB. I found lookup table here . I can use that table for conversion.

FYI: The referred table is not 100% correct. 

?
288 posts


Ah, that's interesting.  Even if the code from VirtualBox isn't 100% correct, I'm sure it'll take a long way.  Good Luck with your project.

__________________
Page 1
1–4

Locked Topic


You must be a member to post in this forum

Join Now!