From 0fab1b499df3eb887786526b4c38827c2027a1e8 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 26 May 2022 20:40:50 -0700 Subject: paste in text with M-v --- keychord.lua | 5 +++++ text.lua | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/keychord.lua b/keychord.lua index 12feef7..07e34cb 100644 --- a/keychord.lua +++ b/keychord.lua @@ -23,3 +23,8 @@ function App.combine_modifiers(key) result = result..key return result end + +function App.modifier_down() + local down = love.keyboard.isDown + return down('lctrl') or down('rctrl') or down('lalt') or down('ralt') or down('lgui') or down('rgui') +end diff --git a/text.lua b/text.lua index 0668d17..ac8adbd 100644 --- a/text.lua +++ b/text.lua @@ -739,6 +739,8 @@ end function Text.textinput(t) if love.mouse.isDown('1') then return end + if App.modifier_down() then return end + local down = love.keyboard.isDown Text.insert_at_cursor(t) end @@ -794,6 +796,12 @@ function Text.keychord_pressed(chord) break end end + -- paste + elseif chord == 'M-v' then + local s = love.system.getClipboardText() + for _,code in utf8.codes(s) do + Text.insert_at_cursor(utf8.char(code)) + end elseif chord == 'home' then Cursor1.pos = 1 elseif chord == 'end' then -- cgit 1.4.1-2-gfad0 tabs'> about summary refs log blame commit diff stats
path: root/linux/bootstrap/039debug.cc
blob: 411818ffcc35a4d7f62d0580e27b65cf4d70bf88 (plain) (tree)
1
2
3
4
5
6
7
8
9