aboutsummaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
authorIBNobody <IBNobody@users.noreply.github.com>2016-06-01 20:41:51 -0500
committerJack Humbert <jack.humb@gmail.com>2016-06-01 21:41:51 -0400
commitf3086b57e634dcc505e3b3c2d3fd0c225de352ea (patch)
treebda78642eb0b734550eaab187be75921b4dc0cdb /keyboard
parent84276ee56145a705a278fd1137f8b945d27d0242 (diff)
downloadqmk_firmware-f3086b57e634dcc505e3b3c2d3fd0c225de352ea.tar.gz
qmk_firmware-f3086b57e634dcc505e3b3c2d3fd0c225de352ea.zip
Submitting ArrowPad, A QMK-based 21/24 key keypad (#372)
* Created arrow pad, a QMK based numpad designed for heavy text editing * Enabled backlighting, numlock indicator, and forced nkro for arrowpad * WIP Arrowpad 21 * WIP Arrowpad 21 * Combined Arrow Pad 21 and 24 * Combined Arrow Pad 21 and 24 * Removed 21 folder
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/arrow_pad/Makefile158
-rw-r--r--keyboard/arrow_pad/README.md24
-rw-r--r--keyboard/arrow_pad/arrow_pad.c114
-rw-r--r--keyboard/arrow_pad/arrow_pad.h18
-rw-r--r--keyboard/arrow_pad/config.h158
-rw-r--r--keyboard/arrow_pad/keymaps/default.c163
-rw-r--r--keyboard/arrow_pad/keymaps/pad_21/config.h158
-rw-r--r--keyboard/arrow_pad/keymaps/pad_21/keymap.c160
-rw-r--r--keyboard/arrow_pad/keymaps/pad_21/makefile.mk17
-rw-r--r--keyboard/arrow_pad/keymaps/pad_24/config.h158
-rw-r--r--keyboard/arrow_pad/keymaps/pad_24/keymap.c163
-rw-r--r--keyboard/arrow_pad/keymaps/pad_24/makefile.mk17
12 files changed, 1308 insertions, 0 deletions
diff --git a/keyboard/arrow_pad/Makefile b/keyboard/arrow_pad/Makefile
new file mode 100644
index 000000000..2c4ee0cae
--- /dev/null
+++ b/keyboard/arrow_pad/Makefile
@@ -0,0 +1,158 @@
1#----------------------------------------------------------------------------
2# On command line:
3#
4# make all = Make software.
5#
6# make clean = Clean out built project files.
7#
8# make coff = Convert ELF to AVR COFF.
9#
10# make extcoff = Convert ELF to AVR Extended COFF.
11#
12# make program = Download the hex file to the device.
13# Please customize your programmer settings(PROGRAM_CMD)
14#
15# make teensy = Download the hex file to the device, using teensy_loader_cli.
16# (must have teensy_loader_cli installed).
17#
18# make dfu = Download the hex file to the device, using dfu-programmer (must
19# have dfu-programmer installed).
20#
21# make flip = Download the hex file to the device, using Atmel FLIP (must
22# have Atmel FLIP installed).
23#
24# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
25# (must have dfu-programmer installed).
26#
27# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
28# (must have Atmel FLIP installed).
29#
30# make debug = Start either simulavr or avarice as specified for debugging,
31# with avr-gdb or avr-insight as the front end for debugging.
32#
33# make filename.s = Just compile filename.c into the assembler code only.
34#
35# make filename.i = Create a preprocessed source file for use in submitting
36# bug reports to the GCC project.
37#
38# To rebuild project do "make clean" then "make all".
39#----------------------------------------------------------------------------
40
41# Target file name (without extension).
42TARGET = arrow_pad
43
44
45# Directory common source filess exist
46TOP_DIR = ../..
47TMK_DIR = ../../tmk_core
48
49# Directory keyboard dependent files exist
50TARGET_DIR = .
51
52# # project specific files
53SRC = arrow_pad.c
54
55ifdef KEYMAP
56 SRC := keymaps/$(KEYMAP).c $(SRC)
57else
58 SRC := keymaps/default.c $(SRC)
59endif
60
61CONFIG_H = config.h
62
63# MCU name
64#MCU = at90usb1287
65MCU = atmega32u4
66
67# Processor frequency.
68# This will define a symbol, F_CPU, in all source code files equal to the
69# processor frequency in Hz. You can then use this symbol in your source code to
70# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
71# automatically to create a 32-bit value in your source code.
72#
73# This will be an integer division of F_USB below, as it is sourced by
74# F_USB after it has run through any CPU prescalers. Note that this value
75# does not *change* the processor frequency - it should merely be updated to
76# reflect the processor speed set externally so that the code can use accurate
77# software delays.
78F_CPU = 16000000
79
80
81#
82# LUFA specific
83#
84# Target architecture (see library "Board Types" documentation).
85ARCH = AVR8
86
87# Input clock frequency.
88# This will define a symbol, F_USB, in all source code files equal to the
89# input clock frequency (before any prescaling is performed) in Hz. This value may
90# differ from F_CPU if prescaling is used on the latter, and is required as the
91# raw input clock is fed directly to the PLL sections of the AVR for high speed
92# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
93# at the end, this will be done automatically to create a 32-bit value in your
94# source code.
95#
96# If no clock division is performed on the input clock inside the AVR (via the
97# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
98F_USB = $(F_CPU)
99
100# Interrupt driven control endpoint task(+60)
101OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
102
103
104# Boot Section Size in *bytes*
105# Teensy halfKay 512
106# Teensy++ halfKay 1024
107# Atmel DFU loader 4096
108# LUFA bootloader 4096
109# USBaspLoader 2048
110OPT_DEFS += -DBOOTLOADER_SIZE=512
111
112
113# Build Options
114# change yes to no to disable
115#
116BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
117MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
118EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
119CONSOLE_ENABLE = yes # Console for debug(+400)
120COMMAND_ENABLE = yes # Commands for debug and configuration
121KEYBOARD_LOCK_ENABLE = yes # Allow locking of keyboard via magic key
122# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
123SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
124# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
125NKRO_ENABLE = yes # USB Nkey Rollover
126BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
127MIDI_ENABLE = no # MIDI controls
128UNICODE_ENABLE = no # Unicode
129BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
130AUDIO_ENABLE = no # Audio output on port C6
131
132
133ifdef KEYMAP
134
135ifeq ("$(wildcard keymaps/$(KEYMAP).c)","")
136ifneq ("$(wildcard keymaps/$(KEYMAP)/makefile.mk)","")
137 include keymaps/$(KEYMAP)/makefile.mk
138endif
139endif
140
141else
142
143ifneq ("$(wildcard keymaps/default/makefile.mk)","")
144 include keymaps/default/makefile.mk
145endif
146
147endif
148
149# Optimize size but this may cause error "relocation truncated to fit"
150#EXTRALDFLAGS = -Wl,--relax
151
152# Search Path
153VPATH += $(TARGET_DIR)
154VPATH += $(TOP_DIR)
155VPATH += $(TMK_DIR)
156
157include $(TOP_DIR)/quantum/quantum.mk
158
diff --git a/keyboard/arrow_pad/README.md b/keyboard/arrow_pad/README.md
new file mode 100644
index 000000000..f669ad6a1
--- /dev/null
+++ b/keyboard/arrow_pad/README.md
@@ -0,0 +1,24 @@
1arrow_pad keyboard firmware
2======================
3
4## Quantum MK Firmware
5
6For the full Quantum feature list, see [the parent README.md](/README.md).
7
8## Building
9
10Download or clone the whole firmware and navigate to the keyboard/arrow_pad folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
11
12Depending on which keymap you would like to use, you will have to compile slightly differently.
13
14### Default
15To build with the default keymap, simply run `make`.
16
17### Other Keymaps
18Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top README.md) and existent keymap files.
19
20To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like:
21```
22$ make KEYMAP=[default|jack|<name>]
23```
24Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder. \ No newline at end of file
diff --git a/keyboard/arrow_pad/arrow_pad.c b/keyboard/arrow_pad/arrow_pad.c
new file mode 100644
index 000000000..f29c2c53f
--- /dev/null
+++ b/keyboard/arrow_pad/arrow_pad.c
@@ -0,0 +1,114 @@
1#include "arrow_pad.h"
2
3__attribute__ ((weak))
4void matrix_init_user(void) {
5 // leave this function blank - it can be defined in a keymap file
6};
7
8__attribute__ ((weak))
9void matrix_scan_user(void) {
10 // leave this function blank - it can be defined in a keymap file
11}
12
13__attribute__ ((weak))
14bool process_action_user(keyrecord_t *record) {
15 // leave this function blank - it can be defined in a keymap file
16 return true;
17}
18
19__attribute__ ((weak))
20void led_set_user(uint8_t usb_led) {
21 // leave this function blank - it can be defined in a keymap file
22}
23
24void matrix_init_kb(void) {
25 // put your keyboard start-up code here
26 // runs once when the firmware starts up
27
28#ifdef BACKLIGHT_ENABLE
29 backlight_init_ports();
30#endif
31
32 matrix_init_user();
33}
34
35void matrix_scan_kb(void) {
36 // put your looping keyboard code here
37 // runs every cycle (a lot)
38
39 matrix_scan_user();
40}
41
42bool process_action_kb(keyrecord_t *record) {
43 // put your per-action keyboard code here
44 // runs for every action, just before processing by the firmware
45
46 return process_action_user(record);
47}
48
49void led_set_kb(uint8_t usb_led) {
50 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
51
52 led_set_user(usb_led);
53}
54
55#ifdef BACKLIGHT_ENABLE
56#define CHANNEL OCR1C
57
58void backlight_init_ports()
59{
60
61 // Setup PB7 as output and output low.
62 DDRB |= (1<<7);
63 PORTB &= ~(1<<7);
64
65 // Use full 16-bit resolution.
66 ICR1 = 0xFFFF;
67
68 // I could write a wall of text here to explain... but TL;DW
69 // Go read the ATmega32u4 datasheet.
70 // And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
71
72 // Pin PB7 = OCR1C (Timer 1, Channel C)
73 // Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
74 // (i.e. start high, go low when counter matches.)
75 // WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
76 // Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
77
78 TCCR1A = _BV(COM1C1) | _BV(WGM11); // = 0b00001010;
79 TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
80
81 backlight_init();
82}
83
84void backlight_set(uint8_t level)
85{
86 if ( level == 0 )
87 {
88 // Turn off PWM control on PB7, revert to output low.
89 TCCR1A &= ~(_BV(COM1C1));
90 CHANNEL = 0x0;
91 // Prevent backlight blink on lowest level
92 PORTB &= ~(_BV(PORTB7));
93 }
94 else if ( level == BACKLIGHT_LEVELS )
95 {
96 // Prevent backlight blink on lowest level
97 PORTB &= ~(_BV(PORTB7));
98 // Turn on PWM control of PB7
99 TCCR1A |= _BV(COM1C1);
100 // Set the brightness
101 CHANNEL = 0xFFFF;
102 }
103 else
104 {
105 // Prevent backlight blink on lowest level
106 PORTB &= ~(_BV(PORTB7));
107 // Turn on PWM control of PB7
108 TCCR1A |= _BV(COM1C1);
109 // Set the brightness
110 CHANNEL = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
111 }
112}
113
114#endif \ No newline at end of file
diff --git a/keyboard/arrow_pad/arrow_pad.h b/keyboard/arrow_pad/arrow_pad.h
new file mode 100644
index 000000000..2026b52d1
--- /dev/null
+++ b/keyboard/arrow_pad/arrow_pad.h
@@ -0,0 +1,18 @@
1#ifndef ARROW_PAD_H
2#define ARROW_PAD_H
3
4#include "matrix.h"
5#include "keymap_common.h"
6#ifdef BACKLIGHT_ENABLE
7 #include "backlight.h"
8#endif
9#include <avr/io.h>
10#include <stddef.h>
11
12void matrix_init_user(void);
13void matrix_scan_user(void);
14bool process_action_user(keyrecord_t *record);
15void led_set_user(uint8_t usb_led);
16void backlight_init_ports(void);
17
18#endif
diff --git a/keyboard/arrow_pad/config.h b/keyboard/arrow_pad/config.h
new file mode 100644
index 000000000..9e85f3ccf
--- /dev/null
+++ b/keyboard/arrow_pad/config.h
@@ -0,0 +1,158 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x4096
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Nobody
28#define PRODUCT GoldPad
29#define DESCRIPTION A custom keyboard
30
31/* key matrix size */
32#define MATRIX_ROWS 6
33#define MATRIX_COLS 4
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 }
46#define MATRIX_COL_PINS { B0, B1, B2, B3 }
47#define UNUSED_PINS
48
49/* COL2ROW or ROW2COL */
50#define DIODE_DIRECTION ROW2COL
51
52/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
53#define DEBOUNCING_DELAY 5
54
55/* define if matrix has ghost (lacks anti-ghosting diodes) */
56//#define MATRIX_HAS_GHOST
57
58/* number of backlight levels */
59#define BACKLIGHT_LEVELS 3
60
61/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
62//#define LOCKING_SUPPORT_ENABLE
63/* Locking resynchronize hack */
64//#define LOCKING_RESYNC_ENABLE
65
66/*
67 * Force NKRO
68 *
69 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
70 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
71 * makefile for this to work.)
72 *
73 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
74 * until the next keyboard reset.
75 *
76 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
77 * fully operational during normal computer usage.
78 *
79 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
80 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
81 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
82 * power-up.
83 *
84 */
85#define FORCE_NKRO
86
87/*
88 * Magic Key Options
89 *
90 * Magic keys are hotkey commands that allow control over firmware functions of
91 * the keyboard. They are best used in combination with the HID Listen program,
92 * found here: https://www.pjrc.com/teensy/hid_listen.html
93 *
94 * The options below allow the magic key functionality to be changed. This is
95 * useful if your keyboard/keypad is missing keys and you want magic key support.
96 *
97 */
98
99/* key combination for magic key command */
100#define IS_COMMAND() ( \
101 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
102)
103
104/* control how magic key switches layers */
105//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
106//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
107//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
108
109/* override magic key keymap */
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
113//#define MAGIC_KEY_HELP1 H
114//#define MAGIC_KEY_HELP2 SLASH
115//#define MAGIC_KEY_DEBUG D
116//#define MAGIC_KEY_DEBUG_MATRIX X
117//#define MAGIC_KEY_DEBUG_KBD K
118//#define MAGIC_KEY_DEBUG_MOUSE M
119//#define MAGIC_KEY_VERSION V
120//#define MAGIC_KEY_STATUS S
121//#define MAGIC_KEY_CONSOLE C
122//#define MAGIC_KEY_LAYER0_ALT1 ESC
123//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
124//#define MAGIC_KEY_LAYER0 0
125//#define MAGIC_KEY_LAYER1 1
126//#define MAGIC_KEY_LAYER2 2
127//#define MAGIC_KEY_LAYER3 3
128//#define MAGIC_KEY_LAYER4 4
129//#define MAGIC_KEY_LAYER5 5
130//#define MAGIC_KEY_LAYER6 6
131//#define MAGIC_KEY_LAYER7 7
132//#define MAGIC_KEY_LAYER8 8
133//#define MAGIC_KEY_LAYER9 9
134//#define MAGIC_KEY_BOOTLOADER PAUSE
135//#define MAGIC_KEY_LOCK CAPS
136//#define MAGIC_KEY_EEPROM E
137//#define MAGIC_KEY_NKRO N
138//#define MAGIC_KEY_SLEEP_LED Z
139
140/*
141 * Feature disable options
142 * These options are also useful to firmware size reduction.
143 */
144
145/* disable debug print */
146//#define NO_DEBUG
147
148/* disable print */
149//#define NO_PRINT
150
151/* disable action features */
152//#define NO_ACTION_LAYER
153//#define NO_ACTION_TAPPING
154//#define NO_ACTION_ONESHOT
155//#define NO_ACTION_MACRO
156//#define NO_ACTION_FUNCTION
157
158#endif
diff --git a/keyboard/arrow_pad/keymaps/default.c b/keyboard/arrow_pad/keymaps/default.c
new file mode 100644
index 000000000..5647f75af
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/default.c
@@ -0,0 +1,163 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "arrow_pad.h"
5#include "led.h"
6
7// This is the 21-key keypad to 2x11 element matrix mapping
8#define KEYMAP( \
9 KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
10 KM_NUM, KM_FSL, KM_AST, KM_MIN, \
11 KM___7, KM___8, KM___9, KM_EQU, \
12 KM___4, KM___5, KM___6, KM_PLS, \
13 KM___1, KM___2, KM___3, ___ENT, \
14 KM___0, _____0, KM_DOT, KM_ENT \
15) { \
16 { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \
17 { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \
18 { KM___7, KM___8, KM___9, KM_EQU }, \
19 { KM___4, KM___5, KM___6, KM_PLS }, \
20 { KM___1, KM___2, KM___3, KC_NO }, \
21 { KM___0, KC_NO, KM_DOT, KM_ENT } \
22}
23
24#define LAYER_BASE 0
25#define LAYER_EDIT 1
26#define LAYER_FUNCTION 2
27
28#define MACRO_COPY_CUT 0
29#define MACRO_SHIFT_CONTROL 1
30#define MACRO_CONTROL_ALT 2
31
32#define M_COPY KC_FN5
33#define M_SHFCT KC_FN6
34#define M_CTALT KC_FN7
35
36#define SC_UNDO LCTL(KC_Z)
37#define SC_REDO LCTL(KC_Y)
38#define SC_CUT LCTL(KC_X)
39#define SC_COPY LCTL(KC_C)
40#define SC_PSTE LCTL(KC_V)
41#define SC_SELA LCTL(KC_A)
42#define SC_SAVE LCTL(KC_S)
43#define SC_OPEN LCTL(KC_O)
44#define SC_ACLS LALT(KC_F4)
45#define SC_CCLS LCTL(KC_F4)
46
47#define _______ KC_TRNS
48#define XXXXXXX KC_NO
49
50const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
51
52[LAYER_BASE] = KEYMAP( \
53 KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
54 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
55 KC_P7, KC_P8, KC_P9, KC_PEQL, \
56 KC_P4, KC_P5, KC_P6, KC_PPLS, \
57 KC_P1, KC_P2, KC_P3, XXXXXXX, \
58 KC_P0, KC_PCMM, KC_PDOT, KC_PENT ),
59
60[LAYER_EDIT] = KEYMAP( \
61 KC_ESC, KC_TAB, KC_SPC, _______, \
62 KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
63 KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
64 KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
65 KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
66 KC_BSPC, KC_PENT, KC_DEL, M_SHFCT),
67
68[LAYER_FUNCTION] = KEYMAP( \
69 KC_FN2, KC_FN3, KC_FN4, _______, \
70 KC_FN1, _______, _______, _______, \
71 _______, _______, _______, _______, \
72 _______, _______, _______, _______, \
73 _______, _______, _______, XXXXXXX, \
74 RESET, _______, _______, _______ ),
75
76};
77
78
79const uint16_t PROGMEM fn_actions[] = {
80 [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
81 [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
82 [2] = ACTION_BACKLIGHT_TOGGLE(),
83 [3] = ACTION_BACKLIGHT_INCREASE(),
84 [4] = ACTION_BACKLIGHT_DECREASE(),
85 [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
86 [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
87 [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
88
89};
90
91
92void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
93{
94}
95
96
97const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
98{
99 // MACRODOWN only works in this function
100 switch (id) {
101
102 case MACRO_COPY_CUT:
103 if (record->event.pressed) {
104 register_code(KC_LCTL);
105 if (record->tap.count == 1) {
106 register_code(KC_C);
107 unregister_code(KC_C);
108 }
109 else if (record->tap.count == 2) {
110 register_code(KC_X);
111 unregister_code(KC_X);
112 }
113 unregister_code(KC_LCTL);
114 }
115 break;
116
117 case MACRO_SHIFT_CONTROL:
118 if (record->event.pressed) {
119 if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
120 if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
121 if (record->tap.count == 3) register_code(KC_PENT);;
122 }
123 else {
124 unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
125 unregister_code(KC_PENT);
126 }
127 break;
128
129 case MACRO_CONTROL_ALT:
130 if (record->event.pressed) {
131 if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
132 if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
133 }
134 else {
135 unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
136 }
137 break;
138 }
139
140 return MACRO_NONE;
141}
142
143void led_set_user(uint8_t usb_led)
144{
145 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
146 // output high
147 DDRD |= (1<<6);
148 PORTD |= (1<<6);
149 } else {
150 // Hi-Z
151 DDRD &= ~(1<<6);
152 PORTD &= ~(1<<6);
153 }
154 if (usb_led & (1<<USB_LED_NUM_LOCK)) {
155 // output low
156 DDRC |= (1<<7);
157 PORTC |= ~(1<<7);
158 } else {
159 // Hi-Z
160 DDRC &= ~(1<<7);
161 PORTC &= ~(1<<7);
162 }
163} \ No newline at end of file
diff --git a/keyboard/arrow_pad/keymaps/pad_21/config.h b/keyboard/arrow_pad/keymaps/pad_21/config.h
new file mode 100644
index 000000000..a095e8737
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_21/config.h
@@ -0,0 +1,158 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x4097
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Nobody
28#define PRODUCT Arrow Pad 21
29#define DESCRIPTION 21-Key QMK Assistant
30
31/* key matrix size */
32#define MATRIX_ROWS 2
33#define MATRIX_COLS 11
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { D3, D5 }
46#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D4 }
47#define UNUSED_PINS
48
49/* COL2ROW or ROW2COL */
50#define DIODE_DIRECTION ROW2COL
51
52/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
53#define DEBOUNCING_DELAY 5
54
55/* define if matrix has ghost (lacks anti-ghosting diodes) */
56//#define MATRIX_HAS_GHOST
57
58/* number of backlight levels */
59#define BACKLIGHT_LEVELS 3
60
61/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
62//#define LOCKING_SUPPORT_ENABLE
63/* Locking resynchronize hack */
64//#define LOCKING_RESYNC_ENABLE
65
66/*
67 * Force NKRO
68 *
69 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
70 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
71 * makefile for this to work.)
72 *
73 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
74 * until the next keyboard reset.
75 *
76 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
77 * fully operational during normal computer usage.
78 *
79 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
80 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
81 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
82 * power-up.
83 *
84 */
85#define FORCE_NKRO
86
87/*
88 * Magic Key Options
89 *
90 * Magic keys are hotkey commands that allow control over firmware functions of
91 * the keyboard. They are best used in combination with the HID Listen program,
92 * found here: https://www.pjrc.com/teensy/hid_listen.html
93 *
94 * The options below allow the magic key functionality to be changed. This is
95 * useful if your keyboard/keypad is missing keys and you want magic key support.
96 *
97 */
98
99/* key combination for magic key command */
100#define IS_COMMAND() ( \
101 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
102)
103
104/* control how magic key switches layers */
105//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
106//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
107//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
108
109/* override magic key keymap */
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
113//#define MAGIC_KEY_HELP1 H
114//#define MAGIC_KEY_HELP2 SLASH
115//#define MAGIC_KEY_DEBUG D
116//#define MAGIC_KEY_DEBUG_MATRIX X
117//#define MAGIC_KEY_DEBUG_KBD K
118//#define MAGIC_KEY_DEBUG_MOUSE M
119//#define MAGIC_KEY_VERSION V
120//#define MAGIC_KEY_STATUS S
121//#define MAGIC_KEY_CONSOLE C
122//#define MAGIC_KEY_LAYER0_ALT1 ESC
123//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
124//#define MAGIC_KEY_LAYER0 0
125//#define MAGIC_KEY_LAYER1 1
126//#define MAGIC_KEY_LAYER2 2
127//#define MAGIC_KEY_LAYER3 3
128//#define MAGIC_KEY_LAYER4 4
129//#define MAGIC_KEY_LAYER5 5
130//#define MAGIC_KEY_LAYER6 6
131//#define MAGIC_KEY_LAYER7 7
132//#define MAGIC_KEY_LAYER8 8
133//#define MAGIC_KEY_LAYER9 9
134//#define MAGIC_KEY_BOOTLOADER PAUSE
135//#define MAGIC_KEY_LOCK CAPS
136//#define MAGIC_KEY_EEPROM E
137//#define MAGIC_KEY_NKRO N
138//#define MAGIC_KEY_SLEEP_LED Z
139
140/*
141 * Feature disable options
142 * These options are also useful to firmware size reduction.
143 */
144
145/* disable debug print */
146//#define NO_DEBUG
147
148/* disable print */
149//#define NO_PRINT
150
151/* disable action features */
152//#define NO_ACTION_LAYER
153//#define NO_ACTION_TAPPING
154//#define NO_ACTION_ONESHOT
155//#define NO_ACTION_MACRO
156//#define NO_ACTION_FUNCTION
157
158#endif
diff --git a/keyboard/arrow_pad/keymaps/pad_21/keymap.c b/keyboard/arrow_pad/keymaps/pad_21/keymap.c
new file mode 100644
index 000000000..28917a5d9
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_21/keymap.c
@@ -0,0 +1,160 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "arrow_pad.h"
5#include "led.h"
6
7// This is the 21-key keypad to 2x11 element matrix mapping
8#define KEYMAP( \
9 KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
10 KM_NUM, KM_FSL, KM_AST, KM_MIN, \
11 KM___7, KM___8, KM___9, ___PLS, \
12 KM___4, KM___5, KM___6, KM_PLS, \
13 KM___1, KM___2, KM___3, ___ENT, \
14 KM___0, _____0, KM_DOT, KM_ENT \
15) { \
16 { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
17 { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
18}
19
20
21#define LAYER_BASE 0
22#define LAYER_EDIT 1
23#define LAYER_FUNCTION 2
24
25#define MACRO_COPY_CUT 0
26#define MACRO_SHIFT_CONTROL 1
27#define MACRO_CONTROL_ALT 2
28
29#define M_COPY KC_FN5
30#define M_SHFCT KC_FN6
31#define M_CTALT KC_FN7
32
33#define SC_UNDO LCTL(KC_Z)
34#define SC_REDO LCTL(KC_Y)
35#define SC_CUT LCTL(KC_X)
36#define SC_COPY LCTL(KC_C)
37#define SC_PSTE LCTL(KC_V)
38#define SC_SELA LCTL(KC_A)
39#define SC_SAVE LCTL(KC_S)
40#define SC_OPEN LCTL(KC_O)
41#define SC_ACLS LALT(KC_F4)
42#define SC_CCLS LCTL(KC_F4)
43
44#define _______ KC_TRNS
45#define XXXXXXX KC_NO
46
47const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
48
49[LAYER_BASE] = KEYMAP( \
50 KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
51 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
52 KC_P7, KC_P8, KC_P9, XXXXXXX, \
53 KC_P4, KC_P5, KC_P6, KC_PPLS, \
54 KC_P1, KC_P2, KC_P3, XXXXXXX, \
55 KC_P0, XXXXXXX, KC_PDOT, KC_PENT ),
56
57[LAYER_EDIT] = KEYMAP( \
58 KC_ESC, KC_TAB, KC_SPC, _______, \
59 KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
60 KC_HOME, KC_UP, KC_PGUP, XXXXXXX, \
61 KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \
62 KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
63 KC_BSPC, XXXXXXX, KC_DEL, M_SHFCT),
64
65[LAYER_FUNCTION] = KEYMAP( \
66 KC_FN2, KC_FN3, KC_FN4, _______, \
67 KC_FN1, _______, _______, _______, \
68 _______, _______, _______, XXXXXXX, \
69 _______, _______, _______, _______, \
70 _______, _______, _______, XXXXXXX, \
71 RESET, XXXXXXX, _______, _______ ),
72
73};
74
75
76const uint16_t PROGMEM fn_actions[] = {
77 [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
78 [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
79 [2] = ACTION_BACKLIGHT_TOGGLE(),
80 [3] = ACTION_BACKLIGHT_INCREASE(),
81 [4] = ACTION_BACKLIGHT_DECREASE(),
82 [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
83 [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
84 [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
85
86};
87
88
89void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
90{
91}
92
93
94const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
95{
96 // MACRODOWN only works in this function
97 switch (id) {
98
99 case MACRO_COPY_CUT:
100 if (record->event.pressed) {
101 register_code(KC_LCTL);
102 if (record->tap.count == 1) {
103 register_code(KC_C);
104 unregister_code(KC_C);
105 }
106 else if (record->tap.count == 2) {
107 register_code(KC_X);
108 unregister_code(KC_X);
109 }
110 unregister_code(KC_LCTL);
111 }
112 break;
113
114 case MACRO_SHIFT_CONTROL:
115 if (record->event.pressed) {
116 if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
117 if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
118 if (record->tap.count == 3) register_code(KC_PENT);;
119 }
120 else {
121 unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
122 unregister_code(KC_PENT);
123 }
124 break;
125
126 case MACRO_CONTROL_ALT:
127 if (record->event.pressed) {
128 if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
129 if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
130 }
131 else {
132 unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
133 }
134 break;
135 }
136
137 return MACRO_NONE;
138}
139
140void led_set_user(uint8_t usb_led)
141{
142 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
143 // output high
144 DDRD |= (1<<6);
145 PORTD |= (1<<6);
146 } else {
147 // Hi-Z
148 DDRD &= ~(1<<6);
149 PORTD &= ~(1<<6);
150 }
151 if (usb_led & (1<<USB_LED_NUM_LOCK)) {
152 // output low
153 DDRC |= (1<<7);
154 PORTC |= ~(1<<7);
155 } else {
156 // Hi-Z
157 DDRC &= ~(1<<7);
158 PORTC &= ~(1<<7);
159 }
160} \ No newline at end of file
diff --git a/keyboard/arrow_pad/keymaps/pad_21/makefile.mk b/keyboard/arrow_pad/keymaps/pad_21/makefile.mk
new file mode 100644
index 000000000..af51976a8
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_21/makefile.mk
@@ -0,0 +1,17 @@
1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = no # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = yes # Commands for debug and configuration
6NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
7BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
8MIDI_ENABLE = no # MIDI controls
9AUDIO_ENABLE = no # Audio output on port C6
10UNICODE_ENABLE = no # Unicode
11BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
12RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
13
14# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
15SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
16
17CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file
diff --git a/keyboard/arrow_pad/keymaps/pad_24/config.h b/keyboard/arrow_pad/keymaps/pad_24/config.h
new file mode 100644
index 000000000..75369c047
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_24/config.h
@@ -0,0 +1,158 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x4096
26#define DEVICE_VER 0x0001
27#define MANUFACTURER Nobody
28#define PRODUCT Arrow Pad 24
29#define DESCRIPTION 24-Key QMK Assistant
30
31/* key matrix size */
32#define MATRIX_ROWS 6
33#define MATRIX_COLS 4
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6, F7 }
46#define MATRIX_COL_PINS { B0, B1, B2, B3 }
47#define UNUSED_PINS
48
49/* COL2ROW or ROW2COL */
50#define DIODE_DIRECTION ROW2COL
51
52/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
53#define DEBOUNCING_DELAY 5
54
55/* define if matrix has ghost (lacks anti-ghosting diodes) */
56//#define MATRIX_HAS_GHOST
57
58/* number of backlight levels */
59#define BACKLIGHT_LEVELS 3
60
61/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
62//#define LOCKING_SUPPORT_ENABLE
63/* Locking resynchronize hack */
64//#define LOCKING_RESYNC_ENABLE
65
66/*
67 * Force NKRO
68 *
69 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
70 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
71 * makefile for this to work.)
72 *
73 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
74 * until the next keyboard reset.
75 *
76 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
77 * fully operational during normal computer usage.
78 *
79 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
80 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
81 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
82 * power-up.
83 *
84 */
85#define FORCE_NKRO
86
87/*
88 * Magic Key Options
89 *
90 * Magic keys are hotkey commands that allow control over firmware functions of
91 * the keyboard. They are best used in combination with the HID Listen program,
92 * found here: https://www.pjrc.com/teensy/hid_listen.html
93 *
94 * The options below allow the magic key functionality to be changed. This is
95 * useful if your keyboard/keypad is missing keys and you want magic key support.
96 *
97 */
98
99/* key combination for magic key command */
100#define IS_COMMAND() ( \
101 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
102)
103
104/* control how magic key switches layers */
105//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
106//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
107//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
108
109/* override magic key keymap */
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
113//#define MAGIC_KEY_HELP1 H
114//#define MAGIC_KEY_HELP2 SLASH
115//#define MAGIC_KEY_DEBUG D
116//#define MAGIC_KEY_DEBUG_MATRIX X
117//#define MAGIC_KEY_DEBUG_KBD K
118//#define MAGIC_KEY_DEBUG_MOUSE M
119//#define MAGIC_KEY_VERSION V
120//#define MAGIC_KEY_STATUS S
121//#define MAGIC_KEY_CONSOLE C
122//#define MAGIC_KEY_LAYER0_ALT1 ESC
123//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
124//#define MAGIC_KEY_LAYER0 0
125//#define MAGIC_KEY_LAYER1 1
126//#define MAGIC_KEY_LAYER2 2
127//#define MAGIC_KEY_LAYER3 3
128//#define MAGIC_KEY_LAYER4 4
129//#define MAGIC_KEY_LAYER5 5
130//#define MAGIC_KEY_LAYER6 6
131//#define MAGIC_KEY_LAYER7 7
132//#define MAGIC_KEY_LAYER8 8
133//#define MAGIC_KEY_LAYER9 9
134//#define MAGIC_KEY_BOOTLOADER PAUSE
135//#define MAGIC_KEY_LOCK CAPS
136//#define MAGIC_KEY_EEPROM E
137//#define MAGIC_KEY_NKRO N
138//#define MAGIC_KEY_SLEEP_LED Z
139
140/*
141 * Feature disable options
142 * These options are also useful to firmware size reduction.
143 */
144
145/* disable debug print */
146//#define NO_DEBUG
147
148/* disable print */
149//#define NO_PRINT
150
151/* disable action features */
152//#define NO_ACTION_LAYER
153//#define NO_ACTION_TAPPING
154//#define NO_ACTION_ONESHOT
155//#define NO_ACTION_MACRO
156//#define NO_ACTION_FUNCTION
157
158#endif
diff --git a/keyboard/arrow_pad/keymaps/pad_24/keymap.c b/keyboard/arrow_pad/keymaps/pad_24/keymap.c
new file mode 100644
index 000000000..5647f75af
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_24/keymap.c
@@ -0,0 +1,163 @@
1// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
2// this is the style you want to emulate.
3
4#include "arrow_pad.h"
5#include "led.h"
6
7// This is the 21-key keypad to 2x11 element matrix mapping
8#define KEYMAP( \
9 KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
10 KM_NUM, KM_FSL, KM_AST, KM_MIN, \
11 KM___7, KM___8, KM___9, KM_EQU, \
12 KM___4, KM___5, KM___6, KM_PLS, \
13 KM___1, KM___2, KM___3, ___ENT, \
14 KM___0, _____0, KM_DOT, KM_ENT \
15) { \
16 { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \
17 { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \
18 { KM___7, KM___8, KM___9, KM_EQU }, \
19 { KM___4, KM___5, KM___6, KM_PLS }, \
20 { KM___1, KM___2, KM___3, KC_NO }, \
21 { KM___0, KC_NO, KM_DOT, KM_ENT } \
22}
23
24#define LAYER_BASE 0
25#define LAYER_EDIT 1
26#define LAYER_FUNCTION 2
27
28#define MACRO_COPY_CUT 0
29#define MACRO_SHIFT_CONTROL 1
30#define MACRO_CONTROL_ALT 2
31
32#define M_COPY KC_FN5
33#define M_SHFCT KC_FN6
34#define M_CTALT KC_FN7
35
36#define SC_UNDO LCTL(KC_Z)
37#define SC_REDO LCTL(KC_Y)
38#define SC_CUT LCTL(KC_X)
39#define SC_COPY LCTL(KC_C)
40#define SC_PSTE LCTL(KC_V)
41#define SC_SELA LCTL(KC_A)
42#define SC_SAVE LCTL(KC_S)
43#define SC_OPEN LCTL(KC_O)
44#define SC_ACLS LALT(KC_F4)
45#define SC_CCLS LCTL(KC_F4)
46
47#define _______ KC_TRNS
48#define XXXXXXX KC_NO
49
50const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
51
52[LAYER_BASE] = KEYMAP( \
53 KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
54 KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
55 KC_P7, KC_P8, KC_P9, KC_PEQL, \
56 KC_P4, KC_P5, KC_P6, KC_PPLS, \
57 KC_P1, KC_P2, KC_P3, XXXXXXX, \
58 KC_P0, KC_PCMM, KC_PDOT, KC_PENT ),
59
60[LAYER_EDIT] = KEYMAP( \
61 KC_ESC, KC_TAB, KC_SPC, _______, \
62 KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
63 KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
64 KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
65 KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
66 KC_BSPC, KC_PENT, KC_DEL, M_SHFCT),
67
68[LAYER_FUNCTION] = KEYMAP( \
69 KC_FN2, KC_FN3, KC_FN4, _______, \
70 KC_FN1, _______, _______, _______, \
71 _______, _______, _______, _______, \
72 _______, _______, _______, _______, \
73 _______, _______, _______, XXXXXXX, \
74 RESET, _______, _______, _______ ),
75
76};
77
78
79const uint16_t PROGMEM fn_actions[] = {
80 [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
81 [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
82 [2] = ACTION_BACKLIGHT_TOGGLE(),
83 [3] = ACTION_BACKLIGHT_INCREASE(),
84 [4] = ACTION_BACKLIGHT_DECREASE(),
85 [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
86 [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
87 [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
88
89};
90
91
92void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
93{
94}
95
96
97const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
98{
99 // MACRODOWN only works in this function
100 switch (id) {
101
102 case MACRO_COPY_CUT:
103 if (record->event.pressed) {
104 register_code(KC_LCTL);
105 if (record->tap.count == 1) {
106 register_code(KC_C);
107 unregister_code(KC_C);
108 }
109 else if (record->tap.count == 2) {
110 register_code(KC_X);
111 unregister_code(KC_X);
112 }
113 unregister_code(KC_LCTL);
114 }
115 break;
116
117 case MACRO_SHIFT_CONTROL:
118 if (record->event.pressed) {
119 if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
120 if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
121 if (record->tap.count == 3) register_code(KC_PENT);;
122 }
123 else {
124 unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
125 unregister_code(KC_PENT);
126 }
127 break;
128
129 case MACRO_CONTROL_ALT:
130 if (record->event.pressed) {
131 if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
132 if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
133 }
134 else {
135 unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
136 }
137 break;
138 }
139
140 return MACRO_NONE;
141}
142
143void led_set_user(uint8_t usb_led)
144{
145 if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
146 // output high
147 DDRD |= (1<<6);
148 PORTD |= (1<<6);
149 } else {
150 // Hi-Z
151 DDRD &= ~(1<<6);
152 PORTD &= ~(1<<6);
153 }
154 if (usb_led & (1<<USB_LED_NUM_LOCK)) {
155 // output low
156 DDRC |= (1<<7);
157 PORTC |= ~(1<<7);
158 } else {
159 // Hi-Z
160 DDRC &= ~(1<<7);
161 PORTC &= ~(1<<7);
162 }
163} \ No newline at end of file
diff --git a/keyboard/arrow_pad/keymaps/pad_24/makefile.mk b/keyboard/arrow_pad/keymaps/pad_24/makefile.mk
new file mode 100644
index 000000000..e31bfe1af
--- /dev/null
+++ b/keyboard/arrow_pad/keymaps/pad_24/makefile.mk
@@ -0,0 +1,17 @@
1BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = no # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = yes # Commands for debug and configuration
6NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
7BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
8MIDI_ENABLE = no # MIDI controls
9AUDIO_ENABLE = no # Audio output on port C6
10UNICODE_ENABLE = no # Unicode
11BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
12RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
13
14# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
15SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
16
17CONFIG_H = keymaps/$(KEYMAP)/config.h \ No newline at end of file