*
* ***** END LICENSE BLOCK ***** */
-#ifndef _GUAC_CLIENT_RDP_KEYMAP
-#define _GUAC_CLIENT_RDP_KEYMAP
+#ifndef _GUAC_RDP_RDP_KEYMAP_H
+#define _GUAC_RDP_RDP_KEYMAP_H
-extern const int guac_rdp_keysym_scancode[256][256];
+/**
+ * Represents a keysym-to-scancode mapping for RDP, with extra information
+ * about the state of prerequisite keysyms.
+ */
+typedef struct guac_rdp_keymap {
+
+ /**
+ * The scancode this keysym maps to.
+ */
+ int scancode;
+
+ /**
+ * Required RDP-specific flags
+ */
+ int flags;
+
+ /**
+ * Null-terminated list of keysyms which must be down for this keysym
+ * to be properly typed.
+ */
+ int* set_keysyms;
+
+ /**
+ * Null-terminated list of keysyms which must be up for this keysym
+ * to be properly typed.
+ */
+ int* clear_keysyms;
+
+} guac_rdp_keymap;
+
+/**
+ * Represents the Alt-code which types a given keysym. This is used as a
+ * fallback mapping, should a particular keymap not support a certain keysym.
+ *
+ * See: http://en.wikipedia.org/wiki/Alt_code
+ */
+typedef struct guac_rdp_alt_keymap {
+
+ /**
+ * The 4-digit Alt-code which types this keysym.
+ */
+ char alt_code[4];
+
+} guac_rdp_alt_keymap;
+
+/**
+ * Map of X11 keysyms to RDP scancodes.
+ */
+extern const guac_rdp_keymap guac_rdp_keysym_scancode[256][256];
+
+/**
+ * Map of X11 keysyms to Windows Alt-codes.
+ */
+extern const guac_rdp_alt_keymap guac_rdp_keysym_altcode[256][256];
#endif