aboutsummaryrefslogtreecommitdiff
path: root/keyboards/handwired/onekey/keymaps/digitizer
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/onekey/keymaps/digitizer')
-rw-r--r--keyboards/handwired/onekey/keymaps/digitizer/keymap.c38
-rw-r--r--keyboards/handwired/onekey/keymaps/digitizer/rules.mk1
2 files changed, 39 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/keymaps/digitizer/keymap.c b/keyboards/handwired/onekey/keymaps/digitizer/keymap.c
new file mode 100644
index 000000000..6b304e86f
--- /dev/null
+++ b/keyboards/handwired/onekey/keymaps/digitizer/keymap.c
@@ -0,0 +1,38 @@
1 /* Copyright 2021 QMK
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18#include "digitizer.h"
19
20#include "math.h"
21
22const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT_ortho_1x1(KC_A)};
23
24uint32_t timer = 0;
25
26void matrix_scan_user() {
27 if (timer_elapsed32(timer) < 200) {
28 return;
29 }
30
31 timer = timer_read32();
32 digitizer_t digitizer;
33 digitizer.x = 0.5 - 0.2 * cos(timer_read() / 250. / 6.28);
34 digitizer.y = 0.5 - 0.2 * sin(timer_read() / 250. / 6.28);
35 digitizer.tipswitch = 0;
36 digitizer.inrange = 1;
37 digitizer_set_report(digitizer);
38}
diff --git a/keyboards/handwired/onekey/keymaps/digitizer/rules.mk b/keyboards/handwired/onekey/keymaps/digitizer/rules.mk
new file mode 100644
index 000000000..ea9f9bd9a
--- /dev/null
+++ b/keyboards/handwired/onekey/keymaps/digitizer/rules.mk
@@ -0,0 +1 @@
DIGITIZER_ENABLE = yes \ No newline at end of file