about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-12-23 20:46:58 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-12-23 20:46:58 -0800
commitd680e1aa4f5ccd489fc1bbc3315add9f09acd50d (patch)
treedc57b537dd2ab8c2610017cb56cef3d13197f390
parent8e782947950cb6c1a0dce2d603e96bd520a52843 (diff)
parente9a517161b378202ea6f3e01b5378b592e1b921f (diff)
downloadview.love-d680e1aa4f5ccd489fc1bbc3315add9f09acd50d.tar.gz
Merge text.love
-rw-r--r--main.lua10
-rw-r--r--source_text_tests.lua2
-rw-r--r--text_tests.lua2
3 files changed, 7 insertions, 7 deletions
diff --git a/main.lua b/main.lua
index d0549f9..b6d1a5d 100644
--- a/main.lua
+++ b/main.lua
@@ -206,16 +206,16 @@ function App.textinput(t)
   end
 end
 
-function App.keyreleased(chord, key)
+function App.keyreleased(key, scancode)
   -- ignore events for some time after window in focus (mostly alt-tab)
   if Current_time < Last_focus_time + 0.01 then
     return
   end
   --
   if Current_app == 'run' then
-    if run.key_release then run.key_release(chord, key) end
+    if run.key_release then run.key_release(key, scancode) end
   elseif Current_app == 'source' then
-    if source.key_release then source.key_release(chord, key) end
+    if source.key_release then source.key_release(key, scancode) end
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
@@ -224,9 +224,9 @@ end
 function App.mousepressed(x,y, mouse_button)
 --?   print('mouse press', x,y)
   if Current_app == 'run' then
-    if run.mouse_pressed then run.mouse_press(x,y, mouse_button) end
+    if run.mouse_press then run.mouse_press(x,y, mouse_button) end
   elseif Current_app == 'source' then
-    if source.mouse_pressed then source.mouse_press(x,y, mouse_button) end
+    if source.mouse_press then source.mouse_press(x,y, mouse_button) end
   else
     assert(false, 'unknown app "'..Current_app..'"')
   end
diff --git a/source_text_tests.lua b/source_text_tests.lua
index 64f041f..795fc0c 100644
--- a/source_text_tests.lua
+++ b/source_text_tests.lua
@@ -607,7 +607,7 @@ function test_select_text()
   edit.run_after_keychord(Editor_state, 'S-right')
   App.fake_key_release('lshift')
   edit.key_release(Editor_state, 'lshift')
-  -- selection persists even after shift is release
+  -- selection persists even after shift is released
   check_eq(Editor_state.selection1.line, 1, 'F - test_select_text/selection:line')
   check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text/selection:pos')
   check_eq(Editor_state.cursor1.line, 1, 'F - test_select_text/cursor:line')
diff --git a/text_tests.lua b/text_tests.lua
index e3cf687..3ba9eed 100644
--- a/text_tests.lua
+++ b/text_tests.lua
@@ -538,7 +538,7 @@ function test_select_text()
   edit.run_after_keychord(Editor_state, 'S-right')
   App.fake_key_release('lshift')
   edit.key_release(Editor_state, 'lshift')
-  -- selection persists even after shift is release
+  -- selection persists even after shift is released
   check_eq(Editor_state.selection1.line, 1, 'F - test_select_text/selection:line')
   check_eq(Editor_state.selection1.pos, 1, 'F - test_select_text/selection:pos')
   check_eq(Editor_state.cursor1.line, 1, 'F - test_select_text/cursor:line')