keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Code_Shift.cpp 476B

12345678910111213141516171819202122232425262728293031323334
  1. #include "Code_Shift.h"
  2. void Code_Shift::press()
  3. {
  4. Keyboard.press(scancode);
  5. pressed = true;
  6. }
  7. void Code_Shift::release()
  8. {
  9. Keyboard.release(scancode);
  10. pressed = false;
  11. }
  12. bool Code_Shift::isPressed()
  13. {
  14. return pressed;
  15. }
  16. void Code_Shift::unpress()
  17. {
  18. if (pressed)
  19. {
  20. Keyboard.release(scancode);
  21. }
  22. }
  23. void Code_Shift::restorePressed()
  24. {
  25. if (pressed)
  26. {
  27. Keyboard.press(scancode);
  28. }
  29. }