Author Topic: put AHK scripts onto an Teensy?  (Read 3362 times)

0 Members and 1 Guest are viewing this topic.

Offline Phenix

  • Thread Starter
  • Posts: 591
  • Location: Germany
put AHK scripts onto an Teensy?
« on: Wed, 08 June 2016, 16:27:39 »
Hello

Just would like to ask if its possible to load ones AHK scripts to the Teensy (of cause as an ŽaddonŽ to the kb firmware itself.
WOuld be super useful cause I have quite some scripts that are useful for on the go
Winter is coming.

Offline xtrafrood

  • formerly csmertx
  • * Elevated Elder
  • Posts: 2715
  • Location: Gainesville, FL
  • wildling
    • csmertx
Re: put AHK scripts onto an Teensy?
« Reply #1 on: Thu, 09 June 2016, 15:20:10 »
If you want your AHK script to run when your OS boots there are ways to do that (Also: USB thumb drive if the computers have the same OS). Teensy's are used so that people can operate the keyboard or mouse in a way that suits them that is independent of the system host's OS. Say I want to use a specific keyboard layout while I work on the bios settings of ten different computers; a Teensy controlled matrix will let me do that. I'm guessing that you just recently learned of making matrixes with a Teensy. Here's a tutorial of how to program the firmware (by Matt3o)

https://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html

With a little more work you can convert a lot of your AHK script to TMK, or QMK, or whatever custom settings you wish to apply but I've never heard of a program made that enables the user to convert AHK scripts into keyboard firmware. I'd think there would be a lot of variables that could cause problems and possibly brick your Teensy :-\
Chris Schammert

Offline MrFex

  • Posts: 112
  • Location: NL
Re: put AHK scripts onto an Teensy?
« Reply #2 on: Thu, 09 June 2016, 17:50:13 »
True. AHK is a Windows program that allows you to use scripting to change the behaviour of input devices and use operating system functions. It manages this by taking advantage of Windows API's. Therefore it is impossible to run AHK on a microcontroller such as Teensy. As csmertx said, the best option you have would be to program it directly into an open source firmware.

I'm pretty sure you need to be a coding ninja to pull this off though. It would be incredible if somebody managed to create a C++ library that can be included in other firmwares and allows you to configure macros via USB that are immediately stored in the controllers memory. You won't get AHK features but it would be great for things like hotkeys and hotstrings. I use AHK for a lot of amazing things ..

Offline Phenix

  • Thread Starter
  • Posts: 591
  • Location: Germany
Re: put AHK scripts onto an Teensy?
« Reply #3 on: Fri, 10 June 2016, 18:24:32 »
Is it possible to use the Teensy as kb firmware + USB thumb drive? (e.g. boot USB thumb driver after 2min)?

@Fox:
True. Would you mind send me/publish your script collection Would like to see what can be handy for me ;)
Winter is coming.

Offline Findecanor

  • Posts: 5040
  • Location: Koriko
Re: put AHK scripts onto an Teensy?
« Reply #4 on: Sat, 11 June 2016, 03:13:56 »
I don't think there is any thumb drive-capable firmware for the Teensy 2.0. There might be one for Arduino that you could adapt but that would probably require quite a bit of programming to adapt it into regular C for avr-gcc.
Also, the internal storage in the Teensy is so small that you'd better use an external chip for storing the files anyway.

It might be easier to install a USB hub and thumb drive into the keyboard enclosure together with the Teensy 2.0. There are some really tiny drives out there.
🍉

Offline MrFex

  • Posts: 112
  • Location: NL
Re: put AHK scripts onto an Teensy?
« Reply #5 on: Sat, 11 June 2016, 13:10:43 »
Here's a nice example of how to turn an Arduino Pro Micro (5 bucks) into a USB HID device. That could be a keyboard, mouse, joystick etc.

The Arduino Pro Micro works great for this purpose. It is powered by a Atmel 32u4 and I believe it has a built-in USB controller as well.
https://geekhack.org/index.php?topic=70994.msg1733191#msg1733191


Offline xtrafrood

  • formerly csmertx
  • * Elevated Elder
  • Posts: 2715
  • Location: Gainesville, FL
  • wildling
    • csmertx
Re: put AHK scripts onto an Teensy?
« Reply #6 on: Sat, 11 June 2016, 13:46:47 »
Here's a nice example of how to turn an Arduino Pro Micro (5 bucks) into a USB HID device. That could be a keyboard, mouse, joystick etc.

The Arduino Pro Micro works great for this purpose. It is powered by a Atmel 32u4 and I believe it has a built-in USB controller as well.
https://geekhack.org/index.php?topic=70994.msg1733191#msg1733191

Really interesting project, thank you for the link!
Chris Schammert

Offline MrFex

  • Posts: 112
  • Location: NL
Re: put AHK scripts onto an Teensy?
« Reply #7 on: Sat, 11 June 2016, 14:23:27 »
Thanks! Let me know if you have more questions and such, I'd love to be able to help!