Add French and German keymaps to build, add failsafe keymap, parse layout parameter, cleanup contributed keymaps, add missing declarations.
This commit is contained in:
parent
b6effd3d4f
commit
7ba047f5a8
@ -55,6 +55,8 @@ libguac_client_rdp_la_SOURCES = \
|
|||||||
src/rdp_keymap_base.c \
|
src/rdp_keymap_base.c \
|
||||||
src/rdp_keymap.c \
|
src/rdp_keymap.c \
|
||||||
src/rdp_keymap_de_de.c \
|
src/rdp_keymap_de_de.c \
|
||||||
|
src/rdp_keymap_failsafe.c \
|
||||||
|
src/rdp_keymap_fr_fr.c \
|
||||||
src/rdp_keymap_en_us.c \
|
src/rdp_keymap_en_us.c \
|
||||||
src/rdp_pointer.c \
|
src/rdp_pointer.c \
|
||||||
src/wav_encoder.c
|
src/wav_encoder.c
|
||||||
|
@ -122,17 +122,27 @@ typedef guac_rdp_keysym_desc guac_rdp_static_keymap[256][256];
|
|||||||
typedef int guac_rdp_keysym_state_map[256][256];
|
typedef int guac_rdp_keysym_state_map[256][256];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of X11 keysyms to RDP scancodes (US English).
|
* US English keymap.
|
||||||
*/
|
*/
|
||||||
extern const guac_rdp_keymap guac_rdp_keymap_en_us;
|
extern const guac_rdp_keymap guac_rdp_keymap_en_us;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of X11 keysyms to RDP scancodes (German).
|
* German keymap.
|
||||||
*/
|
*/
|
||||||
extern const guac_rdp_keymap guac_rdp_keymap_de_de;
|
extern const guac_rdp_keymap guac_rdp_keymap_de_de;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of X11 keysyms to RDP scancodes (common non-printable keys).
|
* French keymap.
|
||||||
|
*/
|
||||||
|
extern const guac_rdp_keymap guac_rdp_keymap_fr_fr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Failsafe (Unicode events for all printable characters) keymap.
|
||||||
|
*/
|
||||||
|
extern const guac_rdp_keymap guac_rdp_keymap_failsafe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Common, base keymap for non-printable keys.
|
||||||
*/
|
*/
|
||||||
extern const guac_rdp_keymap guac_rdp_keymap_base;
|
extern const guac_rdp_keymap guac_rdp_keymap_base;
|
||||||
|
|
||||||
@ -172,6 +182,16 @@ extern const int GUAC_KEYSYMS_ALT[];
|
|||||||
*/
|
*/
|
||||||
extern const int GUAC_KEYSYMS_ALL_ALT[];
|
extern const int GUAC_KEYSYMS_ALL_ALT[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keysym string containing both "alt" keys.
|
||||||
|
*/
|
||||||
|
extern const int GUAC_KEYSYMS_ALL_ALT[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keysym string containing the left "alt" and left "ctrl" keys
|
||||||
|
*/
|
||||||
|
extern const int GUAC_KEYSYMS_CTRL_ALT[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keysym string containing all modifier keys.
|
* Keysym string containing all modifier keys.
|
||||||
*/
|
*/
|
||||||
@ -180,7 +200,7 @@ extern const int GUAC_KEYSYMS_ALL_MODIFIERS[];
|
|||||||
/**
|
/**
|
||||||
* NULL-terminated array of all keymaps.
|
* NULL-terminated array of all keymaps.
|
||||||
*/
|
*/
|
||||||
extern const guac_rpd_keymap* GUAC_KEYMAPS[];
|
extern const guac_rdp_keymap* GUAC_KEYMAPS[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -527,16 +527,37 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
|
|
||||||
/* US English Qwerty */
|
/* US English Qwerty */
|
||||||
if (strcmp("en-us-qwerty", argv[IDX_LAYOUT]) == 0)
|
if (strcmp("en-us-qwerty", argv[IDX_LAYOUT]) == 0)
|
||||||
chosen_keymap = &rdp_guac_keymap_en_us;
|
chosen_keymap = &guac_rdp_keymap_en_us;
|
||||||
|
|
||||||
/* US English Qwerty */
|
/* German Qwertz */
|
||||||
if (strcmp("en-us-qwerty", argv[IDX_LAYOUT]) == 0)
|
else if (strcmp("de-de-qwertz", argv[IDX_LAYOUT]) == 0)
|
||||||
chosen_keymap = &rdp_guac_keymap_en_us;
|
chosen_keymap = &guac_rdp_keymap_de_de;
|
||||||
|
|
||||||
|
/* French Azerty */
|
||||||
|
else if (strcmp("fr-fr-azerty", argv[IDX_LAYOUT]) == 0)
|
||||||
|
chosen_keymap = &guac_rdp_keymap_fr_fr;
|
||||||
|
|
||||||
|
/* Failsafe (Unicode) keymap */
|
||||||
|
else if (strcmp("failsafe", argv[IDX_LAYOUT]) == 0)
|
||||||
|
chosen_keymap = &guac_rdp_keymap_failsafe;
|
||||||
|
|
||||||
|
/* If keymap unknown, resort to failsafe */
|
||||||
|
else {
|
||||||
|
|
||||||
|
guac_client_log_error(client,
|
||||||
|
"Unknown layout \"%s\". Using the failsafe layout instead.",
|
||||||
|
argv[IDX_LAYOUT]);
|
||||||
|
|
||||||
|
chosen_keymap = &guac_rdp_keymap_failsafe;
|
||||||
|
|
||||||
else
|
|
||||||
chosen_keymap = &rdp_guac_keymap_en_us;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If no keymap requested, assume US */
|
||||||
|
else
|
||||||
|
chosen_keymap = &guac_rdp_keymap_en_us;
|
||||||
|
|
||||||
/* Load keymap into client */
|
/* Load keymap into client */
|
||||||
__guac_rdp_client_load_keymap(client, chosen_keymap);
|
__guac_rdp_client_load_keymap(client, chosen_keymap);
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ const int GUAC_KEYSYMS_ALL_CTRL[] = {0xFFE3, 0xFFE4, 0};
|
|||||||
const int GUAC_KEYSYMS_ALT[] = {0xFFE9, 0};
|
const int GUAC_KEYSYMS_ALT[] = {0xFFE9, 0};
|
||||||
const int GUAC_KEYSYMS_ALL_ALT[] = {0xFFE9, 0xFFEA, 0};
|
const int GUAC_KEYSYMS_ALL_ALT[] = {0xFFE9, 0xFFEA, 0};
|
||||||
|
|
||||||
|
const int GUAC_KEYSYMS_CTRL_ALT[] = {0xFFE3, 0xFFE9, 0};
|
||||||
|
|
||||||
const int GUAC_KEYSYMS_ALL_MODIFIERS[] = {
|
const int GUAC_KEYSYMS_ALL_MODIFIERS[] = {
|
||||||
0xFFE1, 0xFFE2, /* Left and right shift */
|
0xFFE1, 0xFFE2, /* Left and right shift */
|
||||||
0xFFE3, 0xFFE4, /* Left and right control */
|
0xFFE3, 0xFFE4, /* Left and right control */
|
||||||
|
63
protocols/rdp/src/rdp_keymap_failsafe.c
Normal file
63
protocols/rdp/src/rdp_keymap_failsafe.c
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Mozilla Public License Version
|
||||||
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
* http://www.mozilla.org/MPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* License.
|
||||||
|
*
|
||||||
|
* The Original Code is libguac-client-rdp.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is
|
||||||
|
* Michael Jumper.
|
||||||
|
* Portions created by the Initial Developer are Copyright (C) 2011
|
||||||
|
* the Initial Developer. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
*
|
||||||
|
* Alternatively, the contents of this file may be used under the terms of
|
||||||
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||||
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||||
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||||
|
* of those above. If you wish to allow use of your version of this file only
|
||||||
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||||
|
* use your version of this file under the terms of the MPL, indicate your
|
||||||
|
* decision by deleting the provisions above and replace them with the notice
|
||||||
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||||
|
* the provisions above, a recipient may use your version of this file under
|
||||||
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
#include <freerdp/input.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_FREERDP_LOCALE_KEYBOARD_H
|
||||||
|
#include <freerdp/locale/keyboard.h>
|
||||||
|
#else
|
||||||
|
#include <freerdp/kbd/layouts.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "rdp_keymap.h"
|
||||||
|
|
||||||
|
static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
|
||||||
|
|
||||||
|
{0}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const guac_rdp_keymap guac_rdp_keymap_failsafe = {
|
||||||
|
|
||||||
|
.name = "failsafe",
|
||||||
|
|
||||||
|
.parent = &guac_rdp_keymap_base,
|
||||||
|
.mapping = __guac_rdp_keymap_mapping,
|
||||||
|
.freerdp_keyboard_layout = KBD_US
|
||||||
|
|
||||||
|
};
|
||||||
|
|
@ -48,12 +48,6 @@
|
|||||||
#include "rdp_keymap.h"
|
#include "rdp_keymap.h"
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
This array is order by .keysym
|
|
||||||
the .keysym is the ASCII value
|
|
||||||
the .scancode the key scancode
|
|
||||||
|
|
||||||
*/
|
|
||||||
static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
|
static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
|
||||||
|
|
||||||
/* space */
|
/* space */
|
||||||
@ -487,7 +481,7 @@ static guac_rdp_keysym_desc __guac_rdp_keymap_mapping[] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
guac_rdp_keymap guac_rdp_keymap_fr_fr = {
|
const guac_rdp_keymap guac_rdp_keymap_fr_fr = {
|
||||||
|
|
||||||
.name = "fr-fr-azerty",
|
.name = "fr-fr-azerty",
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user