Smallish overhaul of Auto-Shift feature (#67)

* Fix edge case when using One Shot Layer with Auto Shift, and it not triggering the cleanup
* Remove junk code (no longer used)
* Replace `(un)register_code` calls with `tap_code` where appropriate
* Fixed up Switch check to be more readable (less verbose)
* Simplified modifier check (if it comes back non-zero, there are mods)
* Add additional function calls for autoshift settings
* Made all variables static, since there are function calls to get their status
* Fixed up documentation
This commit is contained in:
Drashna Jaelre
2019-06-04 02:02:39 -07:00
committed by Florian Didron
parent 524e2b9487
commit 028d02d1f1
3 changed files with 85 additions and 144 deletions

View File

@@ -14,13 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PROCESS_AUTO_SHIFT_H
#define PROCESS_AUTO_SHIFT_H
#pragma once
#include "quantum.h"
#ifndef AUTO_SHIFT_TIMEOUT
#define AUTO_SHIFT_TIMEOUT 175
# define AUTO_SHIFT_TIMEOUT 175
#endif
bool process_auto_shift(uint16_t keycode, keyrecord_t *record);
@@ -28,6 +27,6 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record);
void autoshift_enable(void);
void autoshift_disable(void);
void autoshift_toggle(void);
bool autoshift_state(void);
#endif
bool get_autoshift_state(void);
uint16_t get_autoshift_timeout(void);
void set_autoshift_timeout(uint16_t timeout);