Skip to content

Instantly share code, notes, and snippets.

@hensleyl
Created October 20, 2011 00:33
Show Gist options
  • Save hensleyl/1300096 to your computer and use it in GitHub Desktop.
Save hensleyl/1300096 to your computer and use it in GitHub Desktop.
Use a Microvision ROV Bluetooth Scanner MS2200BT as a keyboard on OSX
framework 'ScriptingBridge'
application = SBApplication.applicationWithBundleIdentifier("com.apple.systemevents")
while true do
begin
File.open('/dev/tty.Cordless-Spp', 'r') do |rov|
while true do
scan = rov.gets
if scan
if scan.size < 20 && scan.chomp =~ /\A\w+\z/
application.keystroke scan, :using => 0
puts scan
end
else
break
end
end
end
rescue Errno::EBUSY
sleep 0.5
retry
end
end
@swizzlevixen
Copy link

By any chance do you still use this ROV scanner on macOS? I'm trying to get my old one working as keyboard entry as well, and would love to know any pointers you have for doing so on a modern macOS version, please? Thanks!

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