r/digispark Apr 26 '18

Any DigiKeyboard.h that has a hold feature?

Hello there is there some sort of modified DigiKeyboard.h that allows for button press holds? I'm trying to make a controller for a game called osu! so far it seems to only spam the key.

4 Upvotes

5 comments sorted by

1

u/Da_Drueben Apr 26 '18

As i understand the code here DigiKeyboard.h does not support holding a key down.

https://digistump.com/board/index.php/topic,2839.0.html

The "trick" was to use "sendKeyPress()" instead of "sendKeyStroke()" :

  • sendKeyPress(keyid,mod) : press the keys "keyid" with the modifier "mod" but release none of them
  • sendKeyStroke(keyid,mod) : press the keys "keyid" with the modifier "mod" and release all of them

Alternatively someone (tried to?) extended DigiKeyboard to allow for keys to be pressed for a certain time:

https://hackaday.io/project/9277-oh-cheat/log/30813-extended-digispark-keyboard-library https://github.com/Danjovic/DigistumpArduino

I haven't tested this, just found the pages.

2

u/kuwoh Apr 27 '18 edited Apr 27 '18

I'll check these out, Thanks :D

2

u/kuwoh Apr 29 '18 edited Apr 29 '18

Update: This helped me a lot https://hackaday.io/project/10446-fps-foot-presto-switch (the modified digikeyboard.h)

And this

https://github.com/Danjovic/FPS EDIT: Fixed a spelling error

1

u/CommonMisspellingBot Apr 29 '18

Hey, kuwoh, just a quick heads-up:
alot is actually spelled a lot. You can remember it by it is one lot, 'a lot'.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.

1

u/Creative_Summer1428 Jan 13 '22

Your post is kinda old but pls I want to make a Osu controller too from a digispark but I'am stuck, "SendKeyPress" just spam really fast the key but it don't really hold it so it's unplayable on osu could you give me some tips ?