better text entry
This commit is contained in:
@@ -252,8 +252,7 @@ function substitutionPage:enable()
|
|||||||
end
|
end
|
||||||
self.grid:update()
|
self.grid:update()
|
||||||
|
|
||||||
self.menuBar.filter.value = ''
|
self.menuBar.filter:reset()
|
||||||
self.menuBar.filter.pos = 1
|
|
||||||
self:setFocus(self.menuBar.filter)
|
self:setFocus(self.menuBar.filter)
|
||||||
UI.Page.enable(self)
|
UI.Page.enable(self)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ local keyMapping = {
|
|||||||
[ 'control-shift-left' ] = 'mark_backword',
|
[ 'control-shift-left' ] = 'mark_backword',
|
||||||
[ 'shift-end' ] = 'mark_end',
|
[ 'shift-end' ] = 'mark_end',
|
||||||
[ 'shift-home' ] = 'mark_home',
|
[ 'shift-home' ] = 'mark_home',
|
||||||
|
[ 'mouse_down' ] = 'mark_anchor',
|
||||||
|
|
||||||
-- editing
|
-- editing
|
||||||
delete = 'delete',
|
delete = 'delete',
|
||||||
@@ -722,6 +723,13 @@ local __actions = {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
mark_anchor = function(nx, ny)
|
||||||
|
actions.go_to(nx, ny)
|
||||||
|
actions.unmark()
|
||||||
|
actions.mark_begin()
|
||||||
|
actions.mark_finish()
|
||||||
|
end,
|
||||||
|
|
||||||
mark_to = function(nx, ny)
|
mark_to = function(nx, ny)
|
||||||
actions.mark_begin()
|
actions.mark_begin()
|
||||||
actions.go_to(nx, ny)
|
actions.go_to(nx, ny)
|
||||||
@@ -1194,6 +1202,7 @@ function input:translate(event, code, p1, p2)
|
|||||||
local buttons = { 'mouse_click', 'mouse_rightclick' }
|
local buttons = { 'mouse_click', 'mouse_rightclick' }
|
||||||
self.mch = buttons[code]
|
self.mch = buttons[code]
|
||||||
self.mfired = nil
|
self.mfired = nil
|
||||||
|
return input:toCode('mouse_down', 255)
|
||||||
|
|
||||||
elseif event == 'mouse_drag' then
|
elseif event == 'mouse_drag' then
|
||||||
self.mfired = true
|
self.mfired = true
|
||||||
@@ -1244,7 +1253,10 @@ while bRunning do
|
|||||||
action = 'exit'
|
action = 'exit'
|
||||||
elseif sEvent == 'multishell_focus' then -- opus only event
|
elseif sEvent == 'multishell_focus' then -- opus only event
|
||||||
input:reset()
|
input:reset()
|
||||||
elseif sEvent == "mouse_click" or sEvent == 'mouse_drag' or sEvent == 'mouse_up' then
|
elseif sEvent == "mouse_click" or
|
||||||
|
sEvent == 'mouse_drag' or
|
||||||
|
sEvent == 'mouse_up' or
|
||||||
|
sEvent == 'mouse_down' then
|
||||||
local ch = input:translate(sEvent, param, param2, param3)
|
local ch = input:translate(sEvent, param, param2, param3)
|
||||||
if param3 < h or sEvent == 'mouse_drag' then
|
if param3 < h or sEvent == 'mouse_drag' then
|
||||||
if ch then
|
if ch then
|
||||||
|
|||||||
Reference in New Issue
Block a user