From 0aa9524204e9c9c002c860b87c972bc2ebf025f3 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 17 Dec 2023 16:48:54 +0100 Subject: [PATCH] main/unl0kr: add workaround to fix fast typing bug (MR 4642) [ci:skip-build]: already built successfully in CI --- ...-keyboard-keys-in-lvgl-directly-afte.patch | 43 +++++++++++++++++++ main/unl0kr/APKBUILD | 10 ++++- 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 main/unl0kr/0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch diff --git a/main/unl0kr/0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch b/main/unl0kr/0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch new file mode 100644 index 000000000..b5de9b495 --- /dev/null +++ b/main/unl0kr/0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch @@ -0,0 +1,43 @@ +Patch https://github.com/calebccff/lv_drivers/pull/5, to be integrated +properly into lv_drivers.git / unl0kr upstream. Add it as separate patch +for now as this is a workaround for the very annoying "can't type fast" +bug and it's v23.12 release day. + +From 36d981a7d4dff6d288c4294cf0763d7c642a2bff Mon Sep 17 00:00:00 2001 +From: jane400 +Date: Sat, 16 Dec 2023 20:38:33 +0100 +Subject: [PATCH] libinput: release keyboard keys in lvgl directly after + pressing + +This enables fast typing on hardware keyboards as keys are no longer forgotten. +--- + indev/libinput.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/indev/libinput.c b/indev/libinput.c +index a78419f..0f63a58 100644 +--- a/indev/libinput.c ++++ b/indev/libinput.c +@@ -677,6 +677,19 @@ static void read_keypad(libinput_drv_state_t *state, struct libinput_event *even + if (evt->key_val != 0) { + /* Only record button state when actual output is produced to prevent widgets from refreshing */ + evt->pressed = (key_state == LIBINPUT_KEY_STATE_RELEASED) ? LV_INDEV_STATE_REL : LV_INDEV_STATE_PR; ++ ++ // just release the key immediatly after it got pressed. ++ // but don't handle special keys where holding a key makes sense ++ if (evt->key_val != LV_KEY_BACKSPACE && ++ evt->key_val != LV_KEY_UP && ++ evt->key_val != LV_KEY_LEFT && ++ evt->key_val != LV_KEY_RIGHT && ++ evt->key_val != LV_KEY_DOWN && ++ key_state == LIBINPUT_KEY_STATE_PRESSED) { ++ libinput_lv_event_t *release_evt = new_event(state); ++ release_evt->pressed = LV_INDEV_STATE_REL; ++ release_evt->key_val = evt->key_val; ++ } + } + break; + default: +-- +2.43.0 + diff --git a/main/unl0kr/APKBUILD b/main/unl0kr/APKBUILD index a32fcc9c6..816b13b29 100644 --- a/main/unl0kr/APKBUILD +++ b/main/unl0kr/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Johannes Marbach pkgname=unl0kr pkgver=2.0.2 -pkgrel=1 +pkgrel=2 _commit_lvgl=2f294aa76c8fece98a4fa72304bc6f267ed2a228 _commit_lv_drivers=7e3135bcae37cbd03c2f003fcc96278671bd8632 _commit_squeek2lvgl=b67685dfede0771d2a237e1d8d4e784fcf406a70 @@ -34,6 +34,7 @@ source=" unl0kr.files unlock.sh 30-unl0kr-test.sh + 0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch " options="!check" # No tests provides="postmarketos-fde-unlocker" @@ -41,11 +42,15 @@ provider_priority=1000 subpackages="$pkgname-doc $pkgname-pmtest" prepare() { - default_prepare + cd "$builddir" mkdir -p lvgl lv_drivers squeek2lvgl mv "$srcdir"/lvgl-"$_commit_lvgl"/* lvgl mv "$srcdir"/lv_drivers-"$_commit_lv_drivers"/* lv_drivers mv "$srcdir"/squeek2lvgl-"$_commit_squeek2lvgl"/* squeek2lvgl + + cd lv_drivers + patch -p1 < "$srcdir"/0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch + cd - } build() { @@ -95,4 +100,5 @@ fbc71bb804d5b766cd515533afd4f44092ffa023b248ac447b743618fa700a95bca8f9aa2ff20b03 521379c06843d31304c7317d083472bb0105da7e9360d7a303cb98c84112919278fa8b50c3781d9cf43bb057b7eb7d52a4f4d900be69a0c0d70f97f2e9843140 unl0kr.files 5386f434cd4f1fb9e0d561a8689e5e85d6a8b3c562823122c082d4932d2fb0ad4edcd635f14f0c61e5c8b5e53648c9937b042409c21683007700faea8894c750 unlock.sh 407180b49c1a05f12bd6ee6e59dca0a6e74fe7b01f195087dcf2865598c47827d0bb569afdba55defa2f9a16437230fa62aa64f35111508b906bcbf9537acba4 30-unl0kr-test.sh +85fbe5bb9ed18a21abc4215b90e4f92f924d81ba4686222c3fe817257f11b75b6ecbca701e75e3ea5cfb481a2c15445b93732fca35e905acc501ef565630bf3a 0001-libinput-release-keyboard-keys-in-lvgl-directly-afte.patch "