views:

160

answers:

1

how do cross platform frameworks like sdl or java provide platform independed keycodes. do they have mapping tables for all possible cases? or is there another (eventually better) way to achieve this.

i need this because i am working on an open source framework for (continuous) dynamic keystroke authentication. i have clients int the form of an java applet, native linux c and native windows c++ code. the clients connect to the server via network sockets and send the captured keystrokes as keycodes with some timing information appended to an server written in c. the problem i'm facing is, that the keycodes for the same key but from different clients differ.

A: 

IME, they usually define their own key constants and place those into their keyboard input event structure (after reading the code in a platform specific manner, which is usually hidden from the user). SDL does it this way at least. I think any method you choose will have a translation table at its core in some way or another. Where that translation takes place (e.g. do you translate at the client or the server?) is up to you.

Bernard