Skip to content

Instantly share code, notes, and snippets.

@r7kamura
Created April 13, 2013 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save r7kamura/5378709 to your computer and use it in GitHub Desktop.
Save r7kamura/5378709 to your computer and use it in GitHub Desktop.
require "mac-event-monitor"
monitor = Mac::EventMonitor::Monitor.new
monitor.add_listener(:key_down) do |event|
system("afplay #{ENV['HOME']}/bin/sounds/#{event.keycode % 14 + 1}.wav &")
end
monitor.run
@r7kamura
Copy link
Author

gem install mac-event-monitor, then prepare {1..14}.wav.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment