Browse Source

Fixed a bug with releasing more keys than were pressed

master
dirkson 6 months ago
parent
commit
f7a8119a24
2 changed files with 18 additions and 10 deletions
  1. +13
    -7
      dict
  2. +5
    -3
      kbd.c

+ 13
- 7
dict View File

@@ -68,7 +68,7 @@
"k": "known",
"ol": "only",
"ths": "these",
"?": "world",
"wd": "world",
"?": "states",
"?": "league",
"?": "found",
@@ -170,7 +170,7 @@
"?": "means",
"?": "university",
"?": "life",
"sys": "system",
"syt": "system",
"?": "died",
"ge": "get",
"?": "family",
@@ -182,7 +182,7 @@
"?": "british",
"?": "we",
"?": "see",
"?": "even",
"ev": "even",
"tng": "things",
"dy": "day",
"?": "show",
@@ -272,7 +272,7 @@
"?": "article",
"?": "top",
"?": "capital",
"?": "down",
"dwn": "down",
"?": "lot",
"?": "children",
"?": "red",
@@ -348,7 +348,7 @@
"?": "kingdom",
"?": "similar",
"?": "special",
"?": "though",
"tgh": "though",
"?": "club",
"?": "here",
"?": "period",
@@ -357,7 +357,7 @@
"?": "animals",
"?": "india",
"?": "term",
"?": "must",
"mst": "must",
"?": "category",
"?": "along",
"?": "simple",
@@ -625,7 +625,7 @@
"?": "goes",
"?": "ocean",
"?": "blood",
"?": "hit",
"hi": "hit",
"?": "grand",
"?": "act",
"?": "pages",
@@ -1004,4 +1004,10 @@
"?": "trade",
"?": "fast",
"?": "african",
"bk": "broken",
"flo": "floor",
"ang": "anger",
"trn": "turn",
"srw": "sorrow",
"blnd": "blind",
}

+ 5
- 3
kbd.c View File

@@ -282,6 +282,7 @@ void kbd_event(int *letters, struct input_event ev, int fdo, int ftty, kbd_state
case KEY_RIGHTMETA:
if (ev.value == 1)
{
//printf("caught meta press\n");
kbd_state->chord = 1;
if (kbd_state->lshift)
{
@@ -351,13 +352,13 @@ void kbd_event(int *letters, struct input_event ev, int fdo, int ftty, kbd_state
}
kbd_state->pressed++;
kbd_state->totalpressed++;
//printf("d: %i %i/%i \n", kbd_state.num, kbd_state.pressed, kbd_state.totalpressed);
//printf("d: %i %i/%i \n", kbd_state->num, kbd_state->pressed, kbd_state->totalpressed);
}
else if (ev.value == 0)
{
kbd_state->pressed--;
//printf("u: %i %i/%i \n", kbd_state.num, kbd_state.pressed, kbd_state.totalpressed);
if (kbd_state->pressed == 0)
//printf("u: %i %i/%i \n", kbd_state->num, kbd_state->pressed, kbd_state->totalpressed);
if (kbd_state->pressed < 1)
{
if (kbd_state->chord == 1)
{
@@ -388,6 +389,7 @@ void kbd_event(int *letters, struct input_event ev, int fdo, int ftty, kbd_state
}

}
kbd_state->pressed = 0;
kbd_state->totalpressed=0;
kbd_state->num=0;
}


Loading…
Cancel
Save