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_AutoShift.cpp 585B

123456789101112131415161718192021222324252627282930
  1. #include "Code_AutoShift.h"
  2. bool Code_AutoShift::isShifted() const
  3. {
  4. //if a shift key is pressed return true else return false
  5. for (uint8_t i = 0; i < shiftCount; i++)
  6. {
  7. if (ptrsShifts[i]->isPressed())
  8. {
  9. return true;
  10. }
  11. }
  12. return false;
  13. }
  14. void Code_AutoShift::releaseAllShifts() const
  15. {
  16. for (uint8_t i = 0; i < shiftCount; i++)
  17. {
  18. ptrsShifts[i]->unpress();
  19. }
  20. }
  21. void Code_AutoShift::restoreAllShifts() const
  22. {
  23. for (uint8_t i = 0; i < shiftCount; i++)
  24. {
  25. ptrsShifts[i]->restorePressed();
  26. }
  27. }