summaryrefslogtreecommitdiff
path: root/xmake/core/ui/choicebox.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-01 00:34:10 +0800
committerruki <[email protected]>2020-12-01 00:34:10 +0800
commit15c4701dd679316802d67d02b2b1c2dd302145bc (patch)
treeb38c3029e2bd3987ea30093e9f6d3800de39fa93 /xmake/core/ui/choicebox.lua
parent73fa95c6caf7600274febaca2018261d7960c546 (diff)
add page down and up events
Diffstat (limited to 'xmake/core/ui/choicebox.lua')
-rw-r--r--xmake/core/ui/choicebox.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/xmake/core/ui/choicebox.lua b/xmake/core/ui/choicebox.lua
index 72964e4d0..f53f53d0f 100644
--- a/xmake/core/ui/choicebox.lua
+++ b/xmake/core/ui/choicebox.lua
@@ -160,6 +160,11 @@ function choicebox:on_event(e)
end
self:_notify_scrolled()
return true
+ elseif e.key_name == "PageDown" or e.key_name == "PageUp" then
+ local direction = e.key_name == "PageDown" and 1 or -1
+ self:scroll(self:height() * direction)
+ self:_notify_scrolled()
+ return true
elseif e.key_name == "Enter" or e.key_name == " " then
self:_do_select()
return true