From d4ae18e2e3e792b391a3070a1fcf1f4f1883e991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Thu, 28 Dec 2023 16:53:44 -0500 Subject: Allow for key repeating --- virtual-programs/editor.folk | 2 +- virtual-programs/keyboard.folk | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/editor.folk b/virtual-programs/editor.folk index f378ec9b..034d2ade 100644 --- a/virtual-programs/editor.folk +++ b/virtual-programs/editor.folk @@ -170,7 +170,7 @@ proc getCurrentLineLength {lines cursor} { When /page/ is a keyboard with path /kbPath/ & /page/ is an editor { set id "$page$kbPath" - Every time keyboard $kbPath claims key /currentCharacter/ is /keyState/ with modifiers /modifier/ & the $kbPath cursor is /cursor/ & $id has program code /code/ & $id has editor code /editorCode/ { + Every time keyboard $kbPath claims key /currentCharacter/ is /keyState/ with modifiers /modifier/ with rand /r/ & the $kbPath cursor is /cursor/ & $id has program code /code/ & $id has editor code /editorCode/ { if {$keyState == "down" || $keyState == "repeat"} { Commit "cursor$kbPath" { switch $currentCharacter { diff --git a/virtual-programs/keyboard.folk b/virtual-programs/keyboard.folk index c52f119c..83c83a5e 100644 --- a/virtual-programs/keyboard.folk +++ b/virtual-programs/keyboard.folk @@ -53,7 +53,7 @@ foreach keyboard $keyboardDevices { Start process "keyboard-$keyboard" { source "pi/KeyCodes.tcl" Wish $::thisProcess shares statements like \ - [list keyboard /kb/ claims key /k/ is /t/ with modifiers /m/] + [list keyboard /kb/ claims key /k/ is /t/ with modifiers /m/ with rand /r/] variable evtBytes 16 variable evtFormat iissi if {[exec getconf LONG_BIT] == 64} { @@ -91,8 +91,8 @@ foreach keyboard $keyboardDevices { } set heldModifiers [dict keys [dict filter $modifiers value 1]] - Retract keyboard $keyboardSpecifier claims key /k/ is /t/ with modifiers /m/ - Assert keyboard $keyboardSpecifier claims key $key is $keyState with modifiers $heldModifiers + Retract keyboard $keyboardSpecifier claims key /k/ is /t/ with modifiers /m/ with rand /r/ + Assert keyboard $keyboardSpecifier claims key $key is $keyState with modifiers $heldModifiers with rand [rand] Step } } -- cgit v1.2.3