lib/rabbit/renderer/display/key-handler.rb in rabbit-2.1.6 vs lib/rabbit/renderer/display/key-handler.rb in rabbit-2.1.7
- old
+ new
@@ -65,34 +65,34 @@
val += 20 if modifier.mod1_mask?
val
end
def init_number_keys
- no_mod = Gdk::Window::ModifierType.new
+ no_mod = Gdk::ModifierType.new
mods = Utils.combination([
- Gdk::Window::ModifierType::CONTROL_MASK,
- Gdk::Window::ModifierType::MOD1_MASK,
+ Gdk::ModifierType::CONTROL_MASK,
+ Gdk::ModifierType::MOD1_MASK,
])
mods.each do |mod|
mod = mod.inject(no_mod) do |result, item|
result | item
end
- keys = (0..9).collect{|i| Gdk::Keyval.const_get("GDK_KEY_#{i}")}
+ keys = (0..9).collect{|i| Gdk::Keyval.const_get("KEY_#{i}")}
set_keys(keys, mod) do |group, obj, val, modifier|
- index = calc_slide_number(val - Gdk::Keyval::GDK_KEY_0, modifier)
+ index = calc_slide_number(val - Gdk::Keyval::KEY_0, modifier)
@canvas.activate("JumpTo") {index}
end
- keys = (0..9).collect{|i| Gdk::Keyval.const_get("GDK_KEY_KP_#{i}")}
+ keys = (0..9).collect{|i| Gdk::Keyval.const_get("KEY_KP_#{i}")}
set_keys(keys, mod) do |group, obj, val, modifier|
- index = calc_slide_number(val - Gdk::Keyval::GDK_KEY_KP_0, modifier)
+ index = calc_slide_number(val - Gdk::Keyval::KEY_KP_0, modifier)
@canvas.activate("JumpTo") {index}
end
end
end
def init_no_prefix_keys
- mod = Gdk::Window::ModifierType.new
+ mod = Gdk::ModifierType.new
keys = Keys::QUIT_KEYS
set_keys(keys, mod) do |group, obj, val, modifier|
@canvas.activate("Quit")
end
@@ -153,11 +153,11 @@
@canvas.activate("StopSlideSearch")
end
end
def init_shift_keys
- mod = Gdk::Window::SHIFT_MASK
+ mod = Gdk::ModifierType::SHIFT_MASK
keys = Keys::Shift::WHITE_OUT_KEYS
set_keys(keys, mod) do |group, obj, val, modifier|
@canvas.activate("ToggleWhiteout")
end
@@ -186,11 +186,11 @@
@canvas.activate("ToggleInfoWindow")
end
end
def init_control_keys
- mod = Gdk::Window::CONTROL_MASK
+ mod = Gdk::ModifierType::CONTROL_MASK
keys = Keys::Control::CLEAR_GRAFFITI_KEYS
set_keys(keys, mod) do |group, obj, val, modifier|
@canvas.activate("ClearGraffiti")
end
@@ -237,11 +237,11 @@
@canvas.activate("PreviousSlide")
end
end
def init_alt_keys
- mod = Gdk::Window::MOD1_MASK
+ mod = Gdk::ModifierType::MOD1_MASK
keys = Keys::Alt::RESET_ADJUSTMENT_KEYS
set_keys(keys, mod) do |group, obj, val, modifier|
@canvas.activate("ResetAdjustment")
end
@@ -252,19 +252,19 @@
end
end
def set_key_press_event(widget)
prev_keys = [
- Gdk::Keyval::GDK_KEY_Up,
- Gdk::Keyval::GDK_KEY_Left,
- Gdk::Keyval::GDK_KEY_KP_Up,
- Gdk::Keyval::GDK_KEY_KP_Left,
+ Gdk::Keyval::KEY_Up,
+ Gdk::Keyval::KEY_Left,
+ Gdk::Keyval::KEY_KP_Up,
+ Gdk::Keyval::KEY_KP_Left,
]
next_keys = [
- Gdk::Keyval::GDK_KEY_Right,
- Gdk::Keyval::GDK_KEY_Down,
- Gdk::Keyval::GDK_KEY_KP_Right,
- Gdk::Keyval::GDK_KEY_KP_Down,
+ Gdk::Keyval::KEY_Right,
+ Gdk::Keyval::KEY_Down,
+ Gdk::Keyval::KEY_KP_Right,
+ Gdk::Keyval::KEY_KP_Down,
]
widget.signal_connect("key_press_event") do |_widget, event|
handled = true
modifier = event.state
case event.keyval