Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to remap keys #52

Open
colindean opened this issue Dec 17, 2014 · 1 comment
Open

Ability to remap keys #52

colindean opened this issue Dec 17, 2014 · 1 comment

Comments

@colindean
Copy link

I just got a Logitech r400 presentation remote. It's not the fanciest thing out there, but it was a gift and I'd like to give it a shot.

Trying to use it with Rabbit is a little... frustrating. There are four buttons:

  • Previous Slide - sends Page Up
  • Next Slide - sends Page Down
  • Play - sends F5 and ESC simultaneously (according to some posts on Amazon)
  • Blackout - sends .

It'd be awesome if I could remap some of these, especially the play and the blackout. F5 fullscreens Rabbit 👍 but if the ESC hits first, the presentation exists 😧 😱

It'd be great if I could execute rabbit with something like --keymap F5=fullscreen --keymap ESC=none --keymap .=black to handle the remapping. That'd be something I could put in my startup script.

@kou
Copy link
Member

kou commented Dec 20, 2014

Rabbit supports changing key bindings in theme.

I created a theme for Logicool Wireless Presenter. Try the following:

(I assume that you use rabbit-slide command to create initial files for Rabbit slide.)

Add runtime dependency to rabbit-theme-logicool-wireless-presenter in Rakefile:

# ...
Rabbit::Task::Slide.new do |task|
  spec = task.spec
  # ...
  spec.add_runtime_dependency("rabbit-theme-logicool-wireless-presenter")
  # ...
end
# ...

Use custom theme by specifying . as theme name in your slide. Here is an example for RD:

= Presentation title

# ...
: theme
   .
# ...

= First slide

# ...

Put include_theme("logicool-wireless-presenter") in ./theme.rb (. theme name means that "Rabbit loads theme.rb file in the current directory as theme file".):

# ./theme.rb
include_theme("logicool-wireless-presenter")
include_theme("default") # If you want to use "default" theme.
# ...

See also: Theme for Logicool Wireless Presenter: https://github.com/kou/rabbit-theme-logicool-wireless-presenter/blob/master/theme.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants