lib/rabbit/renderer/display/key-handler.rb in rabbit-2.2.1 vs lib/rabbit/renderer/display/key-handler.rb in rabbit-3.0.0

- old
+ new

@@ -58,10 +58,15 @@ keys.each do |val| @accel_group.connect(val, mod, flags, &block) end end + def have_slide_number_related_mask?(modifier) + modifier.control_mask? or + modifier.mod1_mask? + end + def calc_slide_number(val, modifier) val += 10 if modifier.control_mask? val += 20 if modifier.mod1_mask? val end @@ -264,17 +269,17 @@ widget.signal_connect("key_press_event") do |_widget, event| handled = true modifier = event.state case event.keyval when *prev_keys - if modifier.nonzero? + if have_slide_number_related_mask?(modifier) index = calc_slide_number(0, modifier) @canvas.activate("JumpTo") {@canvas.current_index - index} else @canvas.activate("PreviousSlide") end when *next_keys - if modifier.nonzero? + if have_slide_number_related_mask?(modifier) index = calc_slide_number(0, modifier) @canvas.activate("JumpTo") {@canvas.current_index + index} else @canvas.activate("NextSlide") end