keybrd library is an open source library for creating custom-keyboard firmware.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

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. }