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.

167 lines
6.3 KiB

  1. # Auto Shift: Why Do We Need a Shift Key?
  2. Tap a key and you get its character. Tap a key, but hold it *slightly* longer
  3. and you get its shifted state. Voilà! No shift key needed!
  4. ## Why Auto Shift?
  5. Many people suffer from various forms of RSI. A common cause is stretching your
  6. fingers repetitively long distances. For us on the keyboard, the pinky does that
  7. all too often when reaching for the shift key. Auto Shift looks to alleviate that
  8. problem.
  9. ## How Does It Work?
  10. When you tap a key, it stays depressed for a short period of time before it is
  11. then released. This depressed time is a different length for everyone. Auto Shift
  12. defines a constant `AUTO_SHIFT_TIMEOUT` which is typically set to twice your
  13. normal pressed state time. When you press a key, a timer starts and then stops
  14. when you release the key. If the time depressed is greater than or equal to the
  15. `AUTO_SHIFT_TIMEOUT`, then a shifted version of the key is emitted. If the time
  16. is less than the `AUTO_SHIFT_TIMEOUT` time, then the normal state is emitted.
  17. ## Are There Limitations to Auto Shift?
  18. Yes, unfortunately.
  19. 1. Key repeat will cease to work. For example, before if you wanted 20 'a'
  20. characters, you could press and hold the 'a' key for a second or two. This no
  21. longer works with Auto Shift because it is timing your depressed time instead
  22. of emitting a depressed key state to your operating system.
  23. 2. You will have characters that are shifted when you did not intend on shifting, and
  24. other characters you wanted shifted, but were not. This simply comes down to
  25. practice. As we get in a hurry, we think we have hit the key long enough
  26. for a shifted version, but we did not. On the other hand, we may think we are
  27. tapping the keys, but really we have held it for a little longer than
  28. anticipated.
  29. ## How Do I Enable Auto Shift?
  30. Add to your `rules.mk` in the keymap folder:
  31. AUTO_SHIFT_ENABLE = yes
  32. If no `rules.mk` exists, you can create one.
  33. Then compile and install your new firmware with Auto Key enabled! That's it!
  34. ## Modifiers
  35. By default, Auto Shift is disabled for any key press that is accompanied by one or more
  36. modifiers. Thus, Ctrl+A that you hold for a really long time is not the same
  37. as Ctrl+Shift+A.
  38. You can re-enable Auto Shift for modifiers by adding a define to your `config.h`
  39. ```c
  40. #define AUTO_SHIFT_MODIFIERS
  41. ```
  42. In which case, Ctrl+A held past the `AUTO_SHIFT_TIMEOUT` will be sent as Ctrl+Shift+A
  43. ## Configuring Auto Shift
  44. If desired, there is some configuration that can be done to change the
  45. behavior of Auto Shift. This is done by setting various variables the
  46. `config.h` file located in your keymap folder. If no `config.h` file exists, you can create one.
  47. A sample is
  48. ```c
  49. #pragma once
  50. #define AUTO_SHIFT_TIMEOUT 150
  51. #define NO_AUTO_SHIFT_SPECIAL
  52. ```
  53. ### AUTO_SHIFT_TIMEOUT (Value in ms)
  54. This controls how long you have to hold a key before you get the shifted state.
  55. Obviously, this is different for everyone. For the common person, a setting of
  56. 135 to 150 works great. However, one should start with a value of at least 175, which
  57. is the default value. Then work down from there. The idea is to have the shortest time required to get the shifted state without having false positives.
  58. Play with this value until things are perfect. Many find that all will work well
  59. at a given value, but one or two keys will still emit the shifted state on
  60. occasion. This is simply due to habit and holding some keys a little longer
  61. than others. Once you find this value, work on tapping your problem keys a little
  62. quicker than normal and you will be set.
  63. ?> Auto Shift has three special keys that can help you get this value right very quick. See "Auto Shift Setup" for more details!
  64. ### NO_AUTO_SHIFT_SPECIAL (simple define)
  65. Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
  66. and /?
  67. ### NO_AUTO_SHIFT_NUMERIC (simple define)
  68. Do not Auto Shift numeric keys, zero through nine.
  69. ### NO_AUTO_SHIFT_ALPHA (simple define)
  70. Do not Auto Shift alpha characters, which include A through Z.
  71. ## Using Auto Shift Setup
  72. This will enable you to define three keys temporarily to increase, decrease and report your `AUTO_SHIFT_TIMEOUT`.
  73. ### Setup
  74. Map three keys temporarily in your keymap:
  75. | Key Name | Description |
  76. |----------|-----------------------------------------------------|
  77. | KC_ASDN | Lower the Auto Shift timeout variable (down) |
  78. | KC_ASUP | Raise the Auto Shift timeout variable (up) |
  79. | KC_ASRP | Report your current Auto Shift timeout value |
  80. | KC_ASON | Turns on the Auto Shift Function |
  81. | KC_ASOFF | Turns off the Auto Shift Function |
  82. | KC_ASTG | Toggles the state of the Auto Shift feature |
  83. Compile and upload your new firmware.
  84. ### Use
  85. It is important to note that during these tests, you should be typing
  86. completely normal and with no intention of shifted keys.
  87. 1. Type multiple sentences of alphabetical letters.
  88. 2. Observe any upper case letters.
  89. 3. If there are none, press the key you have mapped to `KC_ASDN` to decrease
  90. time Auto Shift timeout value and go back to step 1.
  91. 4. If there are some upper case letters, decide if you need to work on tapping
  92. those keys with less down time, or if you need to increase the timeout.
  93. 5. If you decide to increase the timeout, press the key you have mapped to
  94. `KC_ASUP` and go back to step 1.
  95. 6. Once you are happy with your results, press the key you have mapped to
  96. `KC_ASRP`. The keyboard will type by itself the value of your
  97. `AUTO_SHIFT_TIMEOUT`.
  98. 7. Update `AUTO_SHIFT_TIMEOUT` in your `config.h` with the value reported.
  99. 8. Remove `AUTO_SHIFT_SETUP` from your `config.h`.
  100. 9. Remove the key bindings `KC_ASDN`, `KC_ASUP` and `KC_ASRP`.
  101. 10. Compile and upload your new firmware.
  102. #### An Example Run
  103. hello world. my name is john doe. i am a computer programmer playing with
  104. keyboards right now.
  105. [PRESS KC_ASDN quite a few times]
  106. heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH
  107. KEYboArDS RiGHT NOw.
  108. [PRESS KC_ASUP a few times]
  109. hello world. my name is john Doe. i am a computer programmer playing with
  110. keyboarDs right now.
  111. [PRESS KC_ASRP]
  112. 115
  113. The keyboard typed `115` which represents your current `AUTO_SHIFT_TIMEOUT`
  114. value. You are now set! Practice on the *D* key a little bit that showed up
  115. in the testing and you'll be golden.