summaryrefslogtreecommitdiffstats
path: root/virtual-programs
diff options
context:
space:
mode:
authorAndrés Cuervo <andrescuervor@gmail.com>2023-12-01 22:21:38 +0000
committerAndrés Cuervo <andrescuervor@gmail.com>2023-12-01 22:21:38 +0000
commit3e274206342cd85bf36c0d7c63780c3ad55b39a8 (patch)
tree00388f890887ab4750c04ea951f059aec7abf681 /virtual-programs
parentAdd correct retract statement (diff)
downloadfolk-3e274206342cd85bf36c0d7c63780c3ad55b39a8.tar.gz
folk-3e274206342cd85bf36c0d7c63780c3ad55b39a8.zip
Handle repeating keys
Diffstat (limited to 'virtual-programs')
-rw-r--r--virtual-programs/keyboard.folk6
1 files changed, 4 insertions, 2 deletions
diff --git a/virtual-programs/keyboard.folk b/virtual-programs/keyboard.folk
index c39f9c05..955624f6 100644
--- a/virtual-programs/keyboard.folk
+++ b/virtual-programs/keyboard.folk
@@ -99,8 +99,10 @@ foreach keyboard $keyboardDevices {
set eventPathChannel [open $eventPath r]
binary scan [read $eventPathChannel $evtBytes] $evtFormat tvSec tvUsec type code value
}
- if {$type == 0x01 && $value == 1} {
- puts "got key event ($keyboardSpecifier): $code => [keyFromCode $code false] | $value"
+ if {$type == 0x01 && ($value == 1) || ($value == 2)} {
+ set key [keyFromCode $code 0]
+ # puts "shift: [string match *SHIFT $key] | $key"
+ puts "got key event ($keyboardSpecifier): $code => $key | $value"
Retract keyboard $keyboardSpecifier claims key /k/ is /t/
Assert keyboard $keyboardSpecifier claims key [keyFromCode $code false] is [list $value]
Step