FreeBASIC  0.91.0
scancodes.c
Go to the documentation of this file.
1 #include "fb.h"
2 
3 int fb_hScancodeToExtendedKey( int scancode ) {
4  int key;
5 
6  /* FB scancode to FB key translation,
7  currently only used for extended keys. */
8  switch( scancode ) {
9  case SC_F1: key = KEY_F1; break;
10  case SC_F2: key = KEY_F2; break;
11  case SC_F3: key = KEY_F3; break;
12  case SC_F4: key = KEY_F4; break;
13  case SC_F5: key = KEY_F5; break;
14  case SC_F6: key = KEY_F6; break;
15  case SC_F7: key = KEY_F7; break;
16  case SC_F8: key = KEY_F8; break;
17  case SC_F9: key = KEY_F9; break;
18  case SC_F10: key = KEY_F10; break;
19  case SC_HOME: key = KEY_HOME; break;
20  case SC_UP: key = KEY_UP; break;
21  case SC_PAGEUP: key = KEY_PAGE_UP; break;
22  case SC_LEFT: key = KEY_LEFT; break;
23  case SC_CLEAR: key = KEY_CLEAR; break;
24  case SC_RIGHT: key = KEY_RIGHT; break;
25  case SC_END: key = KEY_END; break;
26  case SC_DOWN: key = KEY_DOWN; break;
27  case SC_PAGEDOWN: key = KEY_PAGE_DOWN; break;
28  case SC_INSERT: key = KEY_INS; break;
29  case SC_DELETE: key = KEY_DEL; break;
30  default: key = 0; break;
31  }
32 
33  return key;
34 }