Commit 0ef182eb authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Use uppercase symbols

This change adds "level 4" modifiers, normally resulting from combining AltGr and Shift. Because not all layouts need 4 levels, the key handling procedure becomes aware of the current layout. The added level can be accessed by pressing the AltGr key twice.

The change simplifies `label_from_key` calls in one go.
parent 0a15e1ab
......@@ -122,6 +122,7 @@ struct key {
char *label;
char *uppercase;
char *symbol;
char *symbol_upper;
unsigned keycode;
unsigned int width;
......@@ -135,168 +136,168 @@ struct layout {
uint32_t rows;
const char *language;
bool has_symbol_upper;
};
static const struct key normal_keys[] = {
{ keytype_default, "q", "Q", "1", KEY_Q, 1},
{ keytype_default, "w", "W", "2", KEY_W, 1},
{ keytype_default, "e", "E", "3", KEY_E, 1},
{ keytype_default, "r", "R", "4", KEY_R, 1},
{ keytype_default, "t", "T", "5", KEY_T, 1},
{ keytype_default, "y", "Y", "6", KEY_Y, 1},
{ keytype_default, "u", "U", "7", KEY_U, 1},
{ keytype_default, "i", "I", "8", KEY_I, 1},
{ keytype_default, "o", "O", "9", KEY_O, 1},
{ keytype_default, "p", "P", "0", KEY_P, 1},
{ keytype_backspace, "⌫", "⌫", "⌫", 0, 2},
{ keytype_tab, "⇥", "⇥", "⇥", 0, 1},
{ keytype_default, "a", "A", "-", KEY_A, 1},
{ keytype_default, "s", "S", "@", KEY_S, 1},
{ keytype_default, "d", "D", "*", KEY_D, 1},
{ keytype_default, "f", "F", "^", KEY_F, 1},
{ keytype_default, "g", "G", ":", KEY_G, 1},
{ keytype_default, "h", "H", ";", KEY_H, 1},
{ keytype_default, "j", "J", "(", KEY_J, 1},
{ keytype_default, "k", "K", ")", KEY_K, 1},
{ keytype_default, "l", "L", "~", KEY_L, 1},
{ keytype_enter, "↵", "↵", "↵", 0, 2},
{ keytype_caps, "ABC", "abc", "ABC", 0, 2},
{ keytype_default, "z", "Z", "/", KEY_Z, 1},
{ keytype_default, "x", "X", "\'", KEY_X, 1},
{ keytype_default, "c", "C", "\"", KEY_C, 1},
{ keytype_default, "v", "V", "+", KEY_V, 1},
{ keytype_default, "b", "B", "=", KEY_B, 1},
{ keytype_default, "n", "N", "?", KEY_N, 1},
{ keytype_default, "m", "M", "!", KEY_M, 1},
{ keytype_default, ",", ",", "\\", KEY_COMMA, 1},
{ keytype_default, ".", ".", "|", KEY_DOT, 1},
{ keytype_caps, "ABC", "abc", "ABC", 0, 1},
{ keytype_altgr, "?123", "?123", "abc", 0, 1},
{ keytype_space, "", "", "", 0, 5},
{ keytype_arrow_up, "↑", "↑", "↑", 0, 1},
{ keytype_arrow_left, "←", "←", "←", 0, 1},
{ keytype_arrow_right, "→", "→", "→", 0, 1},
{ keytype_arrow_down, "↓", "↓", "↓", 0, 1},
{ keytype_ctrl, "Ctrl", "Ctrl", "Ctrl", 0, 2}
{ keytype_default, "q", "Q", "1", NULL, KEY_Q, 1},
{ keytype_default, "w", "W", "2", NULL, KEY_W, 1},
{ keytype_default, "e", "E", "3", NULL, KEY_E, 1},
{ keytype_default, "r", "R", "4", NULL, KEY_R, 1},
{ keytype_default, "t", "T", "5", NULL, KEY_T, 1},
{ keytype_default, "y", "Y", "6", NULL, KEY_Y, 1},
{ keytype_default, "u", "U", "7", NULL, KEY_U, 1},
{ keytype_default, "i", "I", "8", NULL, KEY_I, 1},
{ keytype_default, "o", "O", "9", NULL, KEY_O, 1},
{ keytype_default, "p", "P", "0", NULL, KEY_P, 1},
{ keytype_backspace, "⌫", "⌫", "⌫", NULL, 0, 2},
{ keytype_tab, "⇥", "⇥", "⇥", NULL, 0, 1},
{ keytype_default, "a", "A", "-", NULL, KEY_A, 1},
{ keytype_default, "s", "S", "@", NULL, KEY_S, 1},
{ keytype_default, "d", "D", "*", NULL, KEY_D, 1},
{ keytype_default, "f", "F", "^", NULL, KEY_F, 1},
{ keytype_default, "g", "G", ":", NULL, KEY_G, 1},
{ keytype_default, "h", "H", ";", NULL, KEY_H, 1},
{ keytype_default, "j", "J", "(", NULL, KEY_J, 1},
{ keytype_default, "k", "K", ")", NULL, KEY_K, 1},
{ keytype_default, "l", "L", "~", NULL, KEY_L, 1},
{ keytype_enter, "↵", "↵", "↵", NULL, 0, 2},
{ keytype_caps, "ABC", "abc", "ABC", NULL, 0, 2},
{ keytype_default, "z", "Z", "/", NULL, KEY_Z, 1},
{ keytype_default, "x", "X", "\'", NULL, KEY_X, 1},
{ keytype_default, "c", "C", "\"", NULL, KEY_C, 1},
{ keytype_default, "v", "V", "+", NULL, KEY_V, 1},
{ keytype_default, "b", "B", "=", NULL, KEY_B, 1},
{ keytype_default, "n", "N", "?", NULL, KEY_N, 1},
{ keytype_default, "m", "M", "!", NULL, KEY_M, 1},
{ keytype_default, ",", ",", "\\", NULL, KEY_COMMA, 1},
{ keytype_default, ".", ".", "|", NULL, KEY_DOT, 1},
{ keytype_caps, "ABC", "abc", "ABC", NULL, 0, 1},
{ keytype_altgr, "?123", "?123", "abc", NULL, 0, 1},
{ keytype_space, "", "", "", NULL, 0, 5},
{ keytype_arrow_up, "↑", "↑", "↑", NULL, 0, 1},
{ keytype_arrow_left, "←", "←", "←", NULL, 0, 1},
{ keytype_arrow_right, "→", "→", "→", NULL, 0, 1},
{ keytype_arrow_down, "↓", "↓", "↓", NULL, 0, 1},
{ keytype_ctrl, "Ctrl", "Ctrl", "Ctrl", NULL, 0, 2}
};
static const struct key polish_keys[] = {
{ keytype_default, "q", "Q", "1", KEY_Q, 1},
{ keytype_default, "w", "W", "2", KEY_W, 1},
{ keytype_default, "e", "E", "3", KEY_E, 1},
{ keytype_default, "r", "R", "4", KEY_R, 1},
{ keytype_default, "t", "T", "5", KEY_T, 1},
{ keytype_default, "y", "Y", "6", KEY_Y, 1},
{ keytype_default, "u", "U", "7", KEY_U, 1},
{ keytype_default, "i", "I", "8", KEY_I, 1},
{ keytype_default, "o", "O", "9", KEY_O, 1},
{ keytype_default, "p", "P", "0", KEY_P, 1},
{ keytype_backspace, "⌫", "⌫", "⌫", 0, 2},
{ keytype_tab, "⇥", "⇥", "⇥", 0, 1},
{ keytype_default, "a", "A", "-", KEY_A, 1},
{ keytype_default, "s", "S", "@", KEY_S, 1},
{ keytype_default, "d", "D", "*", KEY_D, 1},
{ keytype_default, "f", "F", "^", KEY_F, 1},
{ keytype_default, "g", "G", ":", KEY_G, 1},
{ keytype_default, "h", "H", ";", KEY_H, 1},
{ keytype_default, "j", "J", "(", KEY_J, 1},
{ keytype_default, "k", "K", ")", KEY_K, 1},
{ keytype_default, "l", "L", "~", KEY_L, 1},
{ keytype_enter, "↵", "↵", "↵", 0, 2},
{ keytype_caps, "ABC", "abc", "ABC", 0, 2},
{ keytype_default, "z", "Z", "/", KEY_Z, 1},
{ keytype_default, "x", "X", "\'", KEY_X, 1},
{ keytype_default, "c", "C", "\"", KEY_C, 1},
{ keytype_default, "v", "V", "+", KEY_V, 1},
{ keytype_default, "b", "B", "=", KEY_B, 1},
{ keytype_default, "n", "N", "?", KEY_N, 1},
{ keytype_default, "m", "M", "!", KEY_M, 1},
{ keytype_default, ",", ",", "\\", KEY_COMMA, 1},
{ keytype_default, ".", ".", "|", KEY_DOT, 1},
{ keytype_caps, "ABC", "abc", "ABC", 0, 1},
{ keytype_altgr, "?ąć", "?ąć", "abc", 0, 1},
{ keytype_space, "", "", "", 0, 5},
{ keytype_arrow_up, "↑", "↑", "↑", 0, 1},
{ keytype_arrow_left, "←", "←", "←", 0, 1},
{ keytype_arrow_right, "→", "→", "→", 0, 1},
{ keytype_arrow_down, "↓", "↓", "↓", 0, 1},
{ keytype_ctrl, "Ctrl", "Ctrl", "Ctrl", 0, 2}
{ keytype_default, "q", "Q", "1", "~", KEY_Q, 1},
{ keytype_default, "w", "W", "2", "+", KEY_W, 1},
{ keytype_default, "e", "E", "3", "-", KEY_E, 1},
{ keytype_default, "r", "R", "4", "=", KEY_R, 1},
{ keytype_default, "t", "T", "5", "%", KEY_T, 1},
{ keytype_default, "y", "Y", "6", "^", KEY_Y, 1},
{ keytype_default, "u", "U", "7", "&", KEY_U, 1},
{ keytype_default, "i", "I", "8", "*", KEY_I, 1},
{ keytype_default, "o", "O", "9", "[", KEY_O, 1},
{ keytype_default, "p", "P", "0", "]", KEY_P, 1},
{ keytype_backspace, "⌫", "⌫", "⌫", NULL, 0, 2},
{ keytype_tab, "⇥", "⇥", "⇥", NULL, 0, 1},
{ keytype_default, "a", "A", "ą", ", KEY_A, 1},
{ keytype_default, "s", "S", "ś", ", KEY_S, 1},
{ keytype_default, "d", "D", "ę", ", KEY_D, 1},
{ keytype_default, "f", "F", ":", "_", KEY_F, 1},
{ keytype_default, "g", "G", ";", "'", KEY_G, 1},
{ keytype_default, "h", "H", "(", "{", KEY_H, 1},
{ keytype_default, "j", "J", ")", "}", KEY_J, 1},
{ keytype_default, "k", "K", "ó", ", KEY_K, 1},
{ keytype_default, "l", "L", "ł", ", KEY_L, 1},
{ keytype_enter, "↵", "↵", "↵", NULL, 0, 2},
{ keytype_caps, "ABC", "abc", "abc", NULL, 0, 2},
{ keytype_default, "z", "Z", "ż", ", KEY_Z, 1},
{ keytype_default, "x", "X", "ź", ", KEY_X, 1},
{ keytype_default, "c", "C", "ć", ", KEY_C, 1},
{ keytype_default, "v", "V", "–", "$", KEY_V, 1},
{ keytype_default, "b", "B", "?", "€", KEY_B, 1},
{ keytype_default, "n", "N", "!", "#", KEY_N, 1},
{ keytype_default, "m", "M", "„", ", KEY_M, 1},
{ keytype_default, ",", ",", "”", ", KEY_COMMA, 1},
{ keytype_default, ".", ".", "@", "…", KEY_DOT, 1},
{ keytype_caps, "ABC", "abc", "abc", NULL, 0, 1},
{ keytype_altgr, "ą7?", "ą7?", "Ą%^", "ą7?", 0, 1},
{ keytype_space, "", "", "", NULL, 0, 5},
{ keytype_arrow_up, "↑", "↑", "↑", NULL, 0, 1},
{ keytype_arrow_left, "←", "←", "←", NULL, 0, 1},
{ keytype_arrow_right, "→", "→", "→", NULL, 0, 1},
{ keytype_arrow_down, "↓", "↓", "↓", NULL, 0, 1},
{ keytype_ctrl, "Ctrl", "Ctrl", "Ctrl", NULL, 0, 2}
};
static const struct key numeric_keys[] = {
{ keytype_default, "1", "1", "1", 0, 1},
{ keytype_default, "2", "2", "2", 0, 1},
{ keytype_default, "3", "3", "3", 0, 1},
{ keytype_default, "4", "4", "4", 0, 1},
{ keytype_default, "5", "5", "5", 0, 1},
{ keytype_default, "6", "6", "6", 0, 1},
{ keytype_default, "7", "7", "7", 0, 1},
{ keytype_default, "8", "8", "8", 0, 1},
{ keytype_default, "9", "9", "9", 0, 1},
{ keytype_default, "0", "0", "0", 0, 1},
{ keytype_backspace, "<--", "<--", "<--", 0, 2},
{ keytype_space, "", "", "", 0, 4},
{ keytype_enter, "Enter", "Enter", "Enter", 0, 2},
{ keytype_arrow_up, "/\\", "/\\", "/\\", 0, 1},
{ keytype_arrow_left, "<", "<", "<", 0, 1},
{ keytype_arrow_right, ">", ">", ">", 0, 1},
{ keytype_arrow_down, "\\/", "\\/", "\\/", 0, 1},
//{ keytype_style, "", "", "", 0, 2}
{ keytype_default, "1", "1", "1", NULL, 0, 1},
{ keytype_default, "2", "2", "2", NULL, 0, 1},
{ keytype_default, "3", "3", "3", NULL, 0, 1},
{ keytype_default, "4", "4", "4", NULL, 0, 1},
{ keytype_default, "5", "5", "5", NULL, 0, 1},
{ keytype_default, "6", "6", "6", NULL, 0, 1},
{ keytype_default, "7", "7", "7", NULL, 0, 1},
{ keytype_default, "8", "8", "8", NULL, 0, 1},
{ keytype_default, "9", "9", "9", NULL, 0, 1},
{ keytype_default, "0", "0", "0", NULL, 0, 1},
{ keytype_backspace, "<--", "<--", "<--", NULL, 0, 2},
{ keytype_space, "", "", "", NULL, 0, 4},
{ keytype_enter, "Enter", "Enter", "Enter", NULL, 0, 2},
{ keytype_arrow_up, "/\\", "/\\", "/\\", NULL, 0, 1},
{ keytype_arrow_left, "<", "<", "<", NULL, 0, 1},
{ keytype_arrow_right, ">", ">", ">", NULL, 0, 1},
{ keytype_arrow_down, "\\/", "\\/", "\\/", NULL, 0, 1},
};
static const struct key arabic_keys[] = {
{ keytype_default, "ض", "ﹶ", "۱",0, 1},
{ keytype_default, "ص", "ﹰ", "۲",0, 1},
{ keytype_default, "ث", "ﹸ", "۳",0, 1},
{ keytype_default, "ق", "ﹲ", "۴",0, 1},
{ keytype_default, "ف", "ﻹ", "۵",0, 1},
{ keytype_default, "غ", "ﺇ", "۶",0, 1},
{ keytype_default, "ع", "`", "۷",0, 1},
{ keytype_default, "ه", "٪", "۸",0, 1},
{ keytype_default, "خ", ">", "۹",0, 1},
{ keytype_default, "ح", "<", "۰",0, 1},
{ keytype_backspace, "-->", "-->", "-->", 0, 2},
{ keytype_tab, "->|", "->|", "->|", 0, 1},
{ keytype_default, "ش", "ﹺ", "ﹼ",0, 1},
{ keytype_default, "س", "ﹴ", "!",0, 1},
{ keytype_default, "ي", "[", "@",0, 1},
{ keytype_default, "ب", "]", "#",0, 1},
{ keytype_default, "ل", "ﻷ", "$",0, 1},
{ keytype_default, "ا", "أ", "%",0, 1},
{ keytype_default, "ت", "-", "^",0, 1},
{ keytype_default, "ن", "x", "&", 0, 1},
{ keytype_default, "م", "/", "*",0, 1},
{ keytype_default, "ك", ":", "_",0, 1},
{ keytype_default, "د", "\"", "+",0, 1},
{ keytype_enter, "Enter", "Enter", "Enter", 0, 2},
{ keytype_caps, "Shift", "Base", "Shift", 0, 2},
{ keytype_default, "ئ", "~", ")",0, 1},
{ keytype_default, "ء", "°", "(",0, 1},
{ keytype_default, "ؤ", "{", "\"",0, 1},
{ keytype_default, "ر", "}", "\'",0, 1},
{ keytype_default, "ى", "ﺁ", "؟",0, 1},
{ keytype_default, "ة", "'", "!",0, 1},
{ keytype_default, "و", ",", ";",0, 1},
{ keytype_default, "ﺯ", ".", "\\",0, 1},
{ keytype_default, "ظ", "؟", "=",0, 1},
{ keytype_caps, "Shift", "Base", "Shift", 0, 2},
{ keytype_altgr, "؟٣٢١", "؟٣٢١", "Base", 0, 1},
{ keytype_default, "ﻻ", "ﻵ", "|",0, 1},
{ keytype_default, ",", "،", "،", 0, 1},
{ keytype_space, "", "", "", 0, 6},
{ keytype_default, ".", "ذ", "]",0, 1},
{ keytype_default, "ط", "ﺝ", "[",0, 1},
//{ keytype_style, "", "", "", 0, 2}
{ keytype_default, "ض", "ﹶ", "۱", NULL, 0, 1},
{ keytype_default, "ص", "ﹰ", "۲", NULL, 0, 1},
{ keytype_default, "ث", "ﹸ", "۳", NULL, 0, 1},
{ keytype_default, "ق", "ﹲ", "۴", NULL, 0, 1},
{ keytype_default, "ف", "ﻹ", "۵", NULL, 0, 1},
{ keytype_default, "غ", "ﺇ", "۶", NULL, 0, 1},
{ keytype_default, "ع", "`", "۷", NULL, 0, 1},
{ keytype_default, "ه", "٪", "۸", NULL, 0, 1},
{ keytype_default, "خ", ">", "۹", NULL, 0, 1},
{ keytype_default, "ح", "<", "۰", NULL, 0, 1},
{ keytype_backspace, "-->", "-->", "-->", NULL, 0, 2},
{ keytype_tab, "->|", "->|", "->|", NULL, 0, 1},
{ keytype_default, "ش", "ﹺ", "ﹼ", NULL, 0, 1},
{ keytype_default, "س", "ﹴ", "!", NULL, 0, 1},
{ keytype_default, "ي", "[", "@", NULL, 0, 1},
{ keytype_default, "ب", "]", "#", NULL, 0, 1},
{ keytype_default, "ل", "ﻷ", "$", NULL, 0, 1},
{ keytype_default, "ا", "أ", "%", NULL, 0, 1},
{ keytype_default, "ت", "-", "^", NULL, 0, 1},
{ keytype_default, "ن", "x", "&", NULL, 0, 1},
{ keytype_default, "م", "/", "*", NULL, 0, 1},
{ keytype_default, "ك", ":", "_", NULL, 0, 1},
{ keytype_default, "د", "\"", "+", NULL, 0, 1},
{ keytype_enter, "Enter", "Enter", "Enter", NULL, 0, 2},
{ keytype_caps, "Shift", "Base", "Shift", NULL, 0, 2},
{ keytype_default, "ئ", "~", ")", NULL, 0, 1},
{ keytype_default, "ء", "°", "(", NULL, 0, 1},
{ keytype_default, "ؤ", "{", "\"", NULL, 0, 1},
{ keytype_default, "ر", "}", "\'", NULL, 0, 1},
{ keytype_default, "ى", "ﺁ", "؟", NULL, 0, 1},
{ keytype_default, "ة", "'", "!", NULL, 0, 1},
{ keytype_default, "و", ",", ";", NULL, 0, 1},
{ keytype_default, "ﺯ", ".", "\\", NULL, 0, 1},
{ keytype_default, "ظ", "؟", "=", NULL, 0, 1},
{ keytype_caps, "Shift", "Base", "Shift", NULL, 0, 2},
{ keytype_altgr, "؟٣٢١", "؟٣٢١", "Base", NULL, 0, 1},
{ keytype_default, "ﻻ", "ﻵ", "|", NULL, 0, 1},
{ keytype_default, ",", "،", "،", NULL, 0, 1},
{ keytype_space, "", "", "", NULL, 0, 6},
{ keytype_default, ".", "ذ", "]", NULL, 0, 1},
{ keytype_default, "ط", "ﺝ", "[", NULL, 0, 1},
};
static const struct layout normal_layout = {
......@@ -304,7 +305,8 @@ static const struct layout normal_layout = {
sizeof(normal_keys) / sizeof(*normal_keys),
12,
4,
"en"
"en",
false,
};
static const struct layout numeric_layout = {
......@@ -312,7 +314,8 @@ static const struct layout numeric_layout = {
sizeof(numeric_keys) / sizeof(*numeric_keys),
12,
2,
"en"
"en",
false,
};
static const struct layout arabic_layout = {
......@@ -320,7 +323,8 @@ static const struct layout arabic_layout = {
sizeof(arabic_keys) / sizeof(*arabic_keys),
13,
4,
"ar"
"ar",
false,
};
static const struct layout polish_layout = {
......@@ -328,7 +332,8 @@ static const struct layout polish_layout = {
sizeof(polish_keys) / sizeof(*polish_keys),
12,
4,
"pl"
"pl",
true,
};
static const double key_width = 60;
......@@ -337,7 +342,8 @@ static const double key_height = 50;
enum keyboard_state {
KEYBOARD_STATE_DEFAULT,
KEYBOARD_STATE_UPPERCASE,
KEYBOARD_STATE_SYMBOLS
KEYBOARD_STATE_SYMBOLS,
KEYBOARD_STATE_SYMBOLS_UPPER,
};
struct keyboard {
......@@ -396,8 +402,10 @@ label_from_key(struct keyboard *keyboard,
return key->uppercase;
case KEYBOARD_STATE_SYMBOLS:
return key->symbol;
case KEYBOARD_STATE_SYMBOLS_UPPER:
return key->symbol_upper ? key->symbol_upper : key->symbol;
default:
return "";
dbg("Keyboard state invalid\n");
}
return "";
......@@ -661,6 +669,8 @@ static void keyboard_update_mods(struct keyboard *keyboard) {
case KEYBOARD_STATE_SYMBOLS:
mods |= modifier_altgr;
break;
case KEYBOARD_STATE_SYMBOLS_UPPER:
mods |= modifier_altgr | modifier_shift;
default:
break;
}
......@@ -669,23 +679,12 @@ static void keyboard_update_mods(struct keyboard *keyboard) {
}
static void
keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *key, struct input *input, enum wl_pointer_button_state state)
keyboard_handle_key(struct keyboard *keyboard, const struct layout *layout,
uint32_t time, const struct key *key,
struct input *input,
enum wl_pointer_button_state state)
{
const char *label = NULL;
switch(keyboard->state) {
case KEYBOARD_STATE_DEFAULT :
label = key->label;
break;
case KEYBOARD_STATE_UPPERCASE :
label = key->uppercase;
break;
case KEYBOARD_STATE_SYMBOLS :
label = key->symbol;
break;
default:
dbg("Keyboard state invalid\n");
}
const char *label = label_from_key(keyboard, key);
uint32_t key_state = (state == WL_POINTER_BUTTON_STATE_PRESSED) ? WL_KEYBOARD_KEY_STATE_PRESSED : WL_KEYBOARD_KEY_STATE_RELEASED;
......@@ -765,6 +764,9 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
case KEYBOARD_STATE_SYMBOLS:
keyboard->state = KEYBOARD_STATE_UPPERCASE;
break;
case KEYBOARD_STATE_SYMBOLS_UPPER:
keyboard->state = KEYBOARD_STATE_DEFAULT;
break;
default:
dbg("Keyboard state invalid\n");
}
......@@ -781,7 +783,14 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
keyboard->state = KEYBOARD_STATE_SYMBOLS;
break;
case KEYBOARD_STATE_SYMBOLS:
keyboard->state = KEYBOARD_STATE_DEFAULT;
if (layout->has_symbol_upper) {
keyboard->state = KEYBOARD_STATE_SYMBOLS_UPPER;
} else {
keyboard->state = KEYBOARD_STATE_DEFAULT;
}
break;
case KEYBOARD_STATE_SYMBOLS_UPPER:
keyboard->state = KEYBOARD_STATE_SYMBOLS;
break;
default:
dbg("Keyboard state invalid\n");
......@@ -913,7 +922,10 @@ button_handler(struct widget *widget, struct input *input, uint32_t time,
for (i = 0; i < layout->count; ++i) {
col -= layout->keys[i].width;
if (col < 0) {
keyboard_handle_key(keyboard, time, &layout->keys[i], input, state);
keyboard_handle_key(keyboard, layout,
time, &layout->keys[i],
input,
state);
break;
}
}
......@@ -950,8 +962,10 @@ touch_handler(struct input *input, uint32_t time,
for (i = 0; i < layout->count; ++i) {
col -= layout->keys[i].width;
if (col < 0) {
keyboard_handle_key(keyboard, time,
&layout->keys[i], input, state);
keyboard_handle_key(keyboard, layout,
time, &layout->keys[i],
input,
state);
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment