Skip to content

Commit

Permalink
Merge branch 'master' of github.com:clementgallet/libTAS
Browse files Browse the repository at this point in the history
  • Loading branch information
clementgallet committed Jul 6, 2021
2 parents b9d4507 + 8c21ca0 commit 07217aa
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/library/inputs/xkeyboardlayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ static const char Xlib_default_char[256] = {
debuglogstdio(LCF_KEYBOARD, "%s called with keycode %d", __func__, event_struct->keycode);
// printBacktrace();
KeyCode keycode = event_struct->keycode;
*keysym_return = Xlib_default_keymap[keycode];
if (keysym_return) {
*keysym_return = Xlib_default_keymap[keycode];
}
if (buffer_return && (bytes_buffer > 0)) {
char c = Xlib_default_char[keycode];
if (c == '\0') {
Expand All @@ -196,23 +198,26 @@ static const char Xlib_default_char[256] = {
{
debuglogstdio(LCF_KEYBOARD, "%s called with keycode %d", __func__, event->keycode);
KeyCode keycode = event->keycode;
*keysym_return = Xlib_default_keymap[keycode];
KeySym keysym = Xlib_default_keymap[keycode];

/* Return if no associated keysym */
if (*keysym_return == NoSymbol) {
if (keysym == NoSymbol) {
*status_return = XLookupNone;
return 0;
}

if (keysym_return)
*keysym_return = keysym;

char c = Xlib_default_char[keycode];

/* Return if no associated string */
if (c == '\0') {
*status_return = XLookupKeySym;
*status_return = keysym_return ? XLookupKeySym : XLookupNone;
return 0;
}

*status_return = XLookupBoth;
*status_return = keysym_return ? XLookupBoth : XLookupChars;
if (buffer_return && (bytes_buffer > 0)) {
buffer_return[0] = c;
return 1;
Expand All @@ -224,23 +229,27 @@ static const char Xlib_default_char[256] = {
{
debuglogstdio(LCF_KEYBOARD, "%s called with keycode %d", __func__, event->keycode);
KeyCode keycode = event->keycode;
*keysym_return = Xlib_default_keymap[keycode];
KeySym keysym = Xlib_default_keymap[keycode];

/* Return if no associated keysym */
if (*keysym_return == NoSymbol) {
if (keysym == NoSymbol) {
*status_return = XLookupNone;
return 0;
}

if (keysym_return) {
*keysym_return = keysym;
}

char c = Xlib_default_char[keycode];

/* Return if no associated string */
if (c == '\0') {
*status_return = XLookupKeySym;
*status_return = keysym_return ? XLookupKeySym : XLookupNone;
return 0;
}

*status_return = XLookupBoth;
*status_return = keysym_return ? XLookupBoth : XLookupChars;
if (buffer_return && (wchars_buffer > 0)) {
buffer_return[0] = c;
return 1;
Expand Down

0 comments on commit 07217aa

Please sign in to comment.