A quick portability question -- keyboard codes

Started by
1 comment, last by Ravuya 16 years, 10 months ago
Hi, I'm making a program for Windows that I hope to later port to Linux and Mac. I'm trying to plan ahead by making my generic keycode enums fit as closely as possible to as many platform-specific keycodes as possible. I currently have the documentation for the WinAPI "VK_" keycodes, and I'm looking for something similar for Mac and for the X window system. I'm pretty sure X has very similar "XK_" codes, but I've been wading through [google], Wikipedia, and others for days and I haven't found anything useful. Can someone point me to a page where I can find this? I know this is probably the least of my problems when writing cross-platform programs, and especially when porting from Windows, but every little thing helps!
Advertisement
<X11/keysym.h> and especially <X11/keysymdef.h> are probably what you're looking for.

Hope this helps.
The key-codes under Carbon on OS X are here, though I could swear there are some kConstants somewhere.

Edit: Here are the masks and such for Cocoa development.

This topic is closed to new replies.

Advertisement