keysym2scancode.h File Reference

keysym to scan/keycode conversion using rdesktop keymaps More...

#include "fbvncserver.h"
#include "vnc_keysym.h"

Include dependency graph for keysym2scancode.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void * init_keyboard_layout (const char *language)
int keysym2scancode (void *kbd_layout, int keysym)


Detailed Description

keysym to scan/keycode conversion using rdesktop keymaps

Author:
This code is heavily based on QEMUs keysym to keycode conversion (Copyright © 2004 Johannes Schindelin).

Definition in file keysym2scancode.h.


Function Documentation

void* init_keyboard_layout ( const char *  language  ) 

Definition at line 122 of file keysym2scancode.c.

Referenced by main().

00123 {
00124     return parse_keyboard_layout(language, 0);
00125 } // end of [init_keyboard_layout]

int keysym2scancode ( void *  kbd_layout,
int  keysym 
)

Definition at line 127 of file keysym2scancode.c.

References MAX_NORMAL_KEYCODE.

Referenced by keyevent().

00128 {
00129     kbd_layout_t *k = kbd_layout;
00130     if (keysym < MAX_NORMAL_KEYCODE) {
00131         if (k->keysym2keycode[keysym] == 0)
00132             fprintf(stderr, "Warning: no scancode found for keysym %d\n",
00133                     keysym);
00134         return k->keysym2keycode[keysym];
00135     } else {
00136         int i;
00137 #ifdef XK_ISO_Left_Tab
00138         if (keysym == XK_ISO_Left_Tab)
00139             keysym = XK_Tab;
00140 #endif
00141         for (i = 0; i < k->extra_count; i++)
00142             if (k->keysym2keycode_extra[i].keysym == keysym)
00143                 return k->keysym2keycode_extra[i].keycode;
00144     }
00145     return 0;
00146 }