about summary refs log tree commit diff stats
path: root/app.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-20 10:48:35 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-20 10:48:35 -0700
commit3be413602a59ed735a33712380cedbdb8f5603df (patch)
treeb10cae2e3be410359c1ec66b08c349463d7f5db6 /app.lua
parent9aa7577446ff484b6a2d6713637bfbafe931f458 (diff)
downloadtext.love-3be413602a59ed735a33712380cedbdb8f5603df.tar.gz
bugfix: typing should delete highlighted text
The test harness now also mimics real usage more precisely.
Diffstat (limited to 'app.lua')
-rw-r--r--app.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/app.lua b/app.lua
index a887588..e5be2b0 100644
--- a/app.lua
+++ b/app.lua
@@ -232,14 +232,19 @@ function App.mouse_y()
   return App.fake_mouse_state.y
 end
 
+-- all textinput events are also keypresses
 function App.run_after_textinput(t)
+  App.keypressed(t)
   App.textinput(t)
+  App.keyreleased(t)
   App.screen.contents = {}
   App.draw()
 end
 
-function App.run_after_keychord(key)
-  App.keychord_pressed(key)
+-- not all keys are textinput
+function App.run_after_keychord(chord)
+  App.keychord_pressed(chord)
+  App.keyreleased(chord)
   App.screen.contents = {}
   App.draw()
 end