aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/windows.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-01 00:34:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-01 00:41:17 +0900
commit552c42f51f75eeeaa5a46e2df28fd5dab77261da (patch)
treeaf77c385949813832e8b8d89ee8cf422c04ddbd8 /lib/reline/windows.rb
parent8fc552adee76ec324a219ba6b19fa2e39a1e014e (diff)
downloadruby-552c42f51f75eeeaa5a46e2df28fd5dab77261da.tar.gz
Seprate raw keystroke config for each platforms
Diffstat (limited to 'lib/reline/windows.rb')
-rw-r--r--lib/reline/windows.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb
index b64ea97295..95c30c0246 100644
--- a/lib/reline/windows.rb
+++ b/lib/reline/windows.rb
@@ -1,6 +1,18 @@
require 'fiddle/import'
class Reline::Windows
+ RAW_KEYSTROKE_CONFIG = {
+ key_mapping: {
+ [224, 72] => :ed_prev_history, # ↑
+ [224, 80] => :ed_next_history, # ↓
+ [224, 77] => :ed_next_char, # →
+ [224, 75] => :ed_prev_char, # ←
+ [224, 83] => :key_delete, # Del
+ [224, 71] => :ed_move_to_beg, # Home
+ [224, 79] => :ed_move_to_end, # End
+ }.each_key(&:freeze).freeze,
+ }.freeze
+
class Win32API
DLL = {}
TYPEMAP = {"0" => Fiddle::TYPE_VOID, "S" => Fiddle::TYPE_VOIDP, "I" => Fiddle::TYPE_LONG}