Jump to content

Arduino replacement to Intercept.exe

romibi

After seeing the Macro-Keyboard series by Taran … with the issues with lua and intercept … i thought it should be possible to cheaply intercept keystrokes with something like arduino …

And yes: Some Arduinos can act as keyboards. And there is an USB Host Shield to be able to connect Keyboards (and many more USB Devices) to an Arduino …

 

There are (still) some drawbacks … which might get solved with updated code … see below

 

What you need

How to setup:

  1. Install Arduino IDE
  2. open script attached to this post
  3. install "USB Host Shield Library 2.0" via Library Manager
    (Sketch→Include Library→Manage Libraries … not the USBHost Library)
  4. Connect Arduino,
  5. select Arduino Board Type and port under Tools
  6. Read through code to learn
  7. Upload to Arduino
  8. Connect "Macro Keyboards" to USB Host Shield (and connect that first if not already done)
  9. Check Key presses in AHK (maybe press reset button on Arduino or Shield)
  10. Maybe change order of F-Keys in Code and redo 4-7 or swap usb connections
  11. uninstall intercept.exe?

Pros:

  • Special handling of different Keyboards is outside OS
  • All code is open source
  • relatively cheap for unlimited(?) macros
  • easy to modify
  • theoretically even gamepad & midi devices are supported (not implemented in code but supported by used library)

Cons:

  • Some Keyboards might not work
  • Currently only keys which have an ascii representation are supported*
  • Currently Numpad Numbers are interpreted as normal Numbers*
  • Non-US Layout Keyboards might behave different than expected**
  • Using Arduinos can sound "scary"
    (If you do something wrong you could brick/semi-brick your arduino)

*I tried to change to sending raw keystrokes instead of the "write ascii char" function …
But I somehow managed to brick one of my Arduino Leonardos in the Process … it's quite a bummer because i only got them today

I might attempt it later again (or someone else could?)

** Thats because of the same reason as the "only ascii"-issue

 

(Currently the code supports up to 12 Keyboards connected via up to 4 USB-Hubs … but that is changed easily)

Keyboard_Reprogram.ino

Link to comment
Share on other sites

Link to post
Share on other sites

6 minutes ago, romibi said:

pro cheapskate tip: if you want to avoid using this one, get a cheap keyboard, take it apart, rip the keyboard controller out, reverse engineer the keymap, and use the arduino as your keyboard controller.

 

you could technically skip the "keyboard" part all together, and just piece together a macro keypad with buttons form your favourite components retailer. using just one layer of 3-bit multiplexers you can hook up 136 buttons to the arduino leonardo without resorting to using analog pins as digital I/O, and if you go with two layers for 6 bits worth of multiplexing you can go up to 896 buttons.. which probably pleases even the grandest macro kings of the land.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 3 years later...

Hi, nice idea! I purchased a mini usb host shield. Would this be able to work with it?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×