Skip to content

Commit

Permalink
fixed defaulf keymap, added my own keymap
Browse files Browse the repository at this point in the history
now the LEDs are working like they should
  • Loading branch information
ickerwx committed Aug 25, 2016
1 parent 6a61c89 commit 1bbd3c1
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 105 deletions.
2 changes: 1 addition & 1 deletion keyboards/kitten_paw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE ?= no # Audio output on port C6

CUSTOM_MATRIX = yes
SRC += matrix.c led.c
SRC += matrix.c

ifndef QUANTUM_DIR
include ../../Makefile
Expand Down
128 changes: 75 additions & 53 deletions keyboards/kitten_paw/keymaps/ickerwx/keymap.c

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions keyboards/kitten_paw/keymaps/ickerwx/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# My personal keymap for the Kitten Paw controller

This keymap only works correctly when you have your OS configured with a German keymap. Use the keymap however you like. It's most likely a living thing that will never be quite finished.

## Description of the layers
Layer 0 (DEFAULT) works just like you would expect a keyboard to work, mostly, except:
Caps Lock switches to the mouse layer, RGUI and APP are switches to the programming layer and media layer.
Mouse and programming layer switches can be held or double-tapped to lock.
Holding space switches to the MISC layer where I currently accumulate useful shortcuts.
Tapping left and right Shift, Ctrl and Alt will send (), [] and {} respectively.

Layers 1 and 2 (PROG1 and PROG2) emulate the US layout while still using a German OS keymap setting. I was annoyed of having to change the OS settings every time I wanted to use the US layout for coding, so I made these layers to behave just like the US layout even though the OS still uses German. The shift keys were a bit tricky, I had to use them as MO(PROG2) switches, so to get the actual expected behavior I enable LSFT for almost every keypress on PROG2 in ```process_record_user```. Since the shift keys are MO() function keys, they do not print () at the moment, which sucks. I'm working on it.

Layer 3 (MEDIA) just has a couple of media keys on it, mainly around the cursor keys and nav key cluster.

Layers 4 and 5 (MOUSE1 and MOUSE2) are mouse layers. Move the cursor using ESDF, scroll using HJKL, Space for left click, N and M for right and middle click. There's more, look at the keymap.

Layer 6 is a layer I don't have a good name for, so I call it MISC. You'll find cursor keys at ESDF, other navigation keys around the HJKL cluster and F12 to F24 on the F-keys. For now.
19 changes: 16 additions & 3 deletions keyboards/kitten_paw/kitten_paw.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up

matrix_init_quantum();
matrix_init_user();
}

void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)

matrix_scan_quantum();
matrix_scan_user();
}

Expand All @@ -25,6 +23,21 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {

void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here

CONFIG_LED_IO;
CONFIG_LED_IO;
print_dec(usb_led);
if (usb_led & (1<<USB_LED_CAPS_LOCK))
USB_LED_CAPS_LOCK_ON;
else
USB_LED_CAPS_LOCK_OFF;

if (usb_led & (1<<USB_LED_NUM_LOCK))
USB_LED_NUM_LOCK_ON;
else
USB_LED_NUM_LOCK_OFF;
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
USB_LED_SCROLL_LOCK_ON;
else
USB_LED_SCROLL_LOCK_OFF;
led_set_user(usb_led);
}
11 changes: 11 additions & 0 deletions keyboards/kitten_paw/kitten_paw.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@

#include "quantum.h"

#define CONFIG_LED_IO \
DDRB |= (1<<7); \
DDRC |= (1<<5) | (1<<6);

#define USB_LED_CAPS_LOCK_ON PORTC &= ~(1<<6)
#define USB_LED_CAPS_LOCK_OFF PORTC |= (1<<6)
#define USB_LED_NUM_LOCK_ON PORTB &= ~(1<<7)
#define USB_LED_NUM_LOCK_OFF PORTB |= (1<<7)
#define USB_LED_SCROLL_LOCK_ON PORTC &= ~(1<<5)
#define USB_LED_SCROLL_LOCK_OFF PORTC |= (1<<5)

// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
Expand Down
47 changes: 0 additions & 47 deletions keyboards/kitten_paw/led.c

This file was deleted.

3 changes: 2 additions & 1 deletion keyboards/kitten_paw/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void matrix_init(void) {
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
matrix_init_quantum();
}

uint8_t matrix_scan(void) {
Expand Down Expand Up @@ -94,7 +95,7 @@ uint8_t matrix_scan(void) {
}
}
}

matrix_scan_quantum();
return 1;
}

Expand Down

0 comments on commit 1bbd3c1

Please sign in to comment.