Browse Source

Add crkbd keymap by manna harbour

This keymap includes crkbd-specific hardware feature support.  It provides easy
selection of the following:

- hotswap trackpoint module in OLED port, or OLED with new or old drivers
- automatic mouse buttons layer activation on trackpoint movement
- keyboard-side mouse acceleration, or low rates for use with host-side
  acceleration
- static image display, or use as caps lock indicator
- built-in logo, or image from data file, with automatic rotation
- automatic conversion of image files
- matrix, light, or underglow RGB

It imports miryoku, an ergonomic, minimal, orthogonal layout for ergo or ortho
keyboards.
pull/9461/head
Manna Harbour 3 years ago
parent
commit
8a5f1f8570
8 changed files with 845 additions and 0 deletions
  1. +98
    -0
      keyboards/crkbd/keymaps/manna-harbour/config.h
  2. +181
    -0
      keyboards/crkbd/keymaps/manna-harbour/keymap.c
  3. +8
    -0
      keyboards/crkbd/keymaps/manna-harbour/mh_image.h
  4. +42
    -0
      keyboards/crkbd/keymaps/manna-harbour/mh_image_to_oled
  5. +40
    -0
      keyboards/crkbd/keymaps/manna-harbour/mh_images/converted/corne.c
  6. +40
    -0
      keyboards/crkbd/keymaps/manna-harbour/mh_images/converted/qmk.c
  7. +336
    -0
      keyboards/crkbd/keymaps/manna-harbour/readme.org
  8. +100
    -0
      keyboards/crkbd/keymaps/manna-harbour/rules.mk

+ 98
- 0
keyboards/crkbd/keymaps/manna-harbour/config.h View File

@ -0,0 +1,98 @@
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#pragma once
#define EE_HANDS
#if defined MH_MODULE_TRACKPOINT && defined PS2_MOUSE_ENABLE
// clock on pin 3 (d0, int0)
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 0
#define PS2_INT_INIT() do { EICRA |= ((1<<ISC01) | (0<<ISC00)); } while (0)
#define PS2_INT_ON() do { EIMSK |= (1<<INT0); } while (0)
#define PS2_INT_OFF() do { EIMSK &= ~(1<<INT0); } while (0)
#define PS2_INT_VECT INT0_vect
// data on pin 2 (d1)
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 1
#define PS2_MOUSE_ROTATE 270 // compensate for east-facing device orientation
#define PS2_MOUSE_SCROLL_BTN_MASK (1 << PS2_MOUSE_BTN_MIDDLE)
#define PS2_MOUSE_SCROLL_BTN_SEND TAPPING_TERM
#define PS2_MOUSE_SCROLL_DIVISOR_V 3
#define PS2_MOUSE_SCROLL_DIVISOR_H PS2_MOUSE_SCROLL_DIVISOR_V
#endif
#if defined MH_AUTO_BUTTONS
#define MH_AUTO_BUTTONS_LAYER MBO
#define MH_AUTO_BUTTONS_TIMEOUT 750
#endif
#if !defined MH_LOW_MOUSE && defined PS2_MOUSE_ENABLE
#define PS2_MOUSE_X_MULTIPLIER 3
#define PS2_MOUSE_Y_MULTIPLIER PS2_MOUSE_X_MULTIPLIER
#define PS2_MOUSE_USE_2_1_SCALING
#endif
#if defined MH_LOW_MOUSE && defined MOUSEKEY_ENABLE
#undef MOUSEKEY_TIME_TO_MAX
#define MOUSEKEY_TIME_TO_MAX 128
#endif
#if defined MH_LOW_MOUSE
#undef PRODUCT
#define PRODUCT Corne Keyboard (crkbd) with low rate mouse
#endif
#if defined OLED_DRIVER_ENABLE
#define OLED_TIMEOUT 30000 // ms
#define MH_OLED_TIMEOUT
#endif
#if defined RGB_MATRIX_ENABLE
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120
#define RGB_MATRIX_HUE_STEP 8
#define RGB_MATRIX_SAT_STEP 8
#define RGB_MATRIX_VAL_STEP 8
#define RGB_MATRIX_SPD_STEP 10
#define MH_RGB_TOGGLE_OFF
#endif
#if defined RGBLIGHT_ENABLE
#undef RGBLED_NUM
#if defined MH_RGB_UNDERGLOW
#define RGBLED_NUM 6
#else
#define RGBLED_NUM 27
#endif
#define RGBLIGHT_SLEEP
#define RGBLIGHT_LIMIT_VAL 120
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_SPLIT
#endif
#if defined MH_DEBUG
#define PS2_MOUSE_DEBUG_RAW
#endif
#define LAYOUT_miryoku( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \
N30, N31, K32, K33, K34, K35, K36, K37, N38, N39 \
) \
LAYOUT( \
KC_NO, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, KC_NO, \
KC_NO, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KC_NO, \
KC_NO, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, \
K32, K33, K34, K35, K36, K37 \
)

+ 181
- 0
keyboards/crkbd/keymaps/manna-harbour/keymap.c View File

@ -0,0 +1,181 @@
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#include QMK_KEYBOARD_H
#if defined MH_OLED_IMAGE_FILE && defined OLED_DRIVER_ENABLE
#include "mh_image.h"
#endif
#if defined CONSOLE_ENABLE
#include <print.h>
#endif
#if defined PS2_MOUSE_ENABLE
#include "ps2_mouse.h"
#endif
#if defined MOUSEKEY_ENABLE
#include "mousekey.h"
#endif
#if defined SSD1306OLED
#include "ssd1306.h"
#endif
#if defined MH_AUTO_BUTTONS
#include MH_USER_NAME_H // for MH_AUTO_BUTTONS_LAYER
#endif
#if defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE
static uint16_t mh_auto_buttons_timer;
extern int tp_buttons; // mousekey button state set in action.c and used in ps2_mouse.c
void ps2_mouse_moved_user(report_mouse_t *mouse_report) {
if (mh_auto_buttons_timer) {
mh_auto_buttons_timer = timer_read();
} else {
if (!tp_buttons) {
layer_on(MH_AUTO_BUTTONS_LAYER);
mh_auto_buttons_timer = timer_read();
#if defined CONSOLE_ENABLE
print("mh_auto_buttons: on\n");
#endif
}
}
}
void matrix_scan_user(void) {
if (mh_auto_buttons_timer && (timer_elapsed(mh_auto_buttons_timer) > MH_AUTO_BUTTONS_TIMEOUT)) {
if (!tp_buttons) {
layer_off(MH_AUTO_BUTTONS_LAYER);
mh_auto_buttons_timer = 0;
#if defined CONSOLE_ENABLE
print("mh_auto_buttons: off\n");
#endif
}
}
}
#endif // defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && #defined MOUSEKEY_ENABLE
#if defined MH_OLED_IMAGE_LOGO && defined OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return isLeftHand ? rotation : OLED_ROTATION_180;
}
void mh_draw_image(void) {
static const char PROGMEM qmk_logo[] = {
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
oled_write_P(qmk_logo, false);
}
#elif defined MH_OLED_IMAGE_FILE && defined OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return isLeftHand || mh_image_portrait ? rotation : OLED_ROTATION_180;
}
void mh_draw_image(void) {
oled_write_raw_P(mh_image, mh_image_size);
}
#endif // defined MH_OLED_IMAGE_FILE && defined OLED_DRIVER_ENABLE
#if defined OLED_DRIVER_ENABLE
#if defined MH_OLED_TIMEOUT
static uint32_t mh_oled_timer;
#endif
void oled_task_user(void) {
#if defined MH_OLED_TIMEOUT
#if defined CONSOLE_ENABLE
uprintf("mh_oled_timer elapsed: %d\n", (int)timer_elapsed32(mh_oled_timer));
#endif
if (timer_elapsed32(mh_oled_timer) > OLED_TIMEOUT) {
oled_off();
return;
}
#endif // defined MH_OLED_TIMEOUT
#if defined MH_OLED_MODE_STATIC
mh_draw_image();
#elif defined MH_OLED_MODE_CAPS
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
mh_draw_image();
} else {
oled_off();
}
#endif // defined MH_OLED_MODE_CAPS
}
#endif // defined OLED_DRIVER_ENABLE
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#if defined MH_OLED_TIMEOUT && defined OLED_DRIVER_ENABLE
if (record->event.pressed) {
mh_oled_timer = timer_read32();
}
#endif // defined MH_OLED_TIMEOUT && defined OLED_DRIVER_ENABLE
#if defined MH_RGB_TOGGLE_OFF && RGB_MATRIX_ENABLE
if (record->event.pressed && (keycode == RGB_TOG) && (get_mods() & MOD_MASK_SHIFT)) {
rgblight_disable();
return false;
}
#endif // defined MH_RGB_TOGGLE_OFF && RGB_MATRIX_ENABLE
return true;
}
#if defined SSD1306OLED
const char *read_logo(void);
void matrix_init_user(void) {
iota_gfx_init(!isLeftHand);
}
void matrix_render_user(struct CharacterMatrix *matrix) {
#if defined MH_OLED_MODE_STATIC
matrix_write(matrix, read_logo());
#elif defined MH_OLED_MODE_CAPS
if (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) {
matrix_write(matrix, read_logo());
}
#endif // defined MH_OLED_MODE_CAPS
}
void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
if (memcmp(dest->display, source->display, sizeof(dest->display))) {
memcpy(dest->display, source->display, sizeof(dest->display));
dest->dirty = true;
}
}
void iota_gfx_task_user(void) {
struct CharacterMatrix matrix;
matrix_clear(&matrix);
matrix_render_user(&matrix);
matrix_update(&display, &matrix);
}
void matrix_scan_user(void) {
iota_gfx_task();
}
#endif // defined SSD1306OLED
#if defined MH_DEBUG
void keyboard_post_init_user(void) {
debug_enable = true;
debug_mouse = true;
}
#endif

+ 8
- 0
keyboards/crkbd/keymaps/manna-harbour/mh_image.h View File

@ -0,0 +1,8 @@
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#pragma once
#include "quantum.h"
extern const char mh_image[] PROGMEM;
extern const int mh_image_size;
extern const bool mh_image_portrait;

+ 42
- 0
keyboards/crkbd/keymaps/manna-harbour/mh_image_to_oled View File

@ -0,0 +1,42 @@
#!/bin/sh
# https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
size=`convert "$1" -ping -format "%wx%h" info:`
case "$size"
in
'32x128'|'64x128')
rotate=180
portrait='true'
;;
'128x32'|'128x64')
rotate=90
portrait='false'
;;
*)
echo "$0: unsupported image size: $size." >&2
exit 65 #EX_DATAERR
esac
cat <<'EOF'
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#include "mh_image.h"
const char mh_image[] PROGMEM = {
EOF
convert "$1" -rotate "$rotate" -crop 8x +repage -gravity North -reverse -append \
-depth 1 GRAY:- | \
xxd -i -c 16
cat <<'EOF'
};
const int mh_image_size = sizeof(mh_image);
EOF
cat <<EOF
const bool mh_image_portrait = $portrait;
EOF

+ 40
- 0
keyboards/crkbd/keymaps/manna-harbour/mh_images/converted/corne.c View File

@ -0,0 +1,40 @@
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#include "mh_image.h"
const char mh_image[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80,
0xc0, 0xc0, 0xe0, 0xc0, 0x40, 0x00, 0x00, 0xc0, 0xe0, 0xf8, 0xfc, 0xfe, 0xfe, 0xff, 0xff, 0xff,
0xff, 0xff, 0xfe, 0xfe, 0xfc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xe0, 0xe0, 0x00, 0x00, 0xf0, 0xfc, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x01, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x1f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
0xf8, 0xfc, 0x1e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0e, 0x1e, 0x3c, 0x38, 0x20, 0x00,
0xe0, 0xf8, 0xfc, 0x1e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0e, 0x1e, 0x7c, 0xf8, 0xf0,
0x00, 0x00, 0xff, 0xff, 0xff, 0x3c, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0xff, 0xff, 0xff,
0x1e, 0x0e, 0x07, 0x07, 0x07, 0x07, 0x07, 0x0e, 0xfe, 0xfc, 0xf8, 0x00, 0x00, 0xe0, 0xf8, 0xfc,
0xde, 0xce, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xc7, 0xce, 0xfe, 0xfc, 0xf8, 0xe0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xf0, 0xc4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
0x1f, 0x3f, 0x78, 0x70, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x70, 0x78, 0x3c, 0x1c, 0x04, 0x00,
0x07, 0x1f, 0x3f, 0x78, 0x70, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x70, 0x78, 0x3e, 0x1f, 0x0f,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x07, 0x1f, 0x3f,
0x79, 0x71, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0xe1, 0x71, 0x79, 0x39, 0x19, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x1f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x1f, 0x1f, 0x1f, 0x3f,
0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x3f, 0x3f, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f, 0xff, 0xff, 0xff,
0xfe, 0xfc, 0xf8, 0x78, 0x7c, 0x3c, 0x3e, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
const int mh_image_size = sizeof(mh_image);
const bool mh_image_portrait = false;

+ 40
- 0
keyboards/crkbd/keymaps/manna-harbour/mh_images/converted/qmk.c View File

@ -0,0 +1,40 @@
// https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#include "mh_image.h"
const char mh_image[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xf0, 0xf0, 0xf8, 0xf8, 0xff, 0xf8, 0xf8, 0xff, 0xff,
0xf8, 0xf8, 0xff, 0xff, 0xf8, 0xf8, 0xff, 0xff, 0xf8, 0xf8, 0xff, 0xf8, 0xf8, 0xf0, 0xf0, 0xc0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0xc0, 0xe0, 0xf0, 0x70, 0x78, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x78, 0x70, 0xf0,
0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0,
0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,
0xf0, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf8, 0xf8, 0xf0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0xf0, 0x78, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0xff, 0xff,
0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc,
0xff, 0xff, 0x0f, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x03,
0x1f, 0x7f, 0xfe, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xfc, 0xff, 0x1f,
0x07, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0xc0, 0xe0, 0xf8, 0xfc, 0x1e, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf8, 0xf1, 0xf3,
0xf7, 0xe7, 0x00, 0x00, 0xe7, 0xf7, 0xf3, 0xf1, 0xf8, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
0xff, 0xff, 0xf0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
0xe0, 0xff, 0xff, 0x7f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x03, 0x1f, 0x7f, 0xfe, 0xf8, 0xc0, 0x80, 0xf0, 0xfc, 0x7f, 0x1f, 0x03, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
0x01, 0x03, 0x07, 0x1f, 0x3e, 0x7c, 0xf8, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x0f, 0x1f, 0x1f, 0xff, 0x1f, 0x1f, 0xff, 0xff,
0x1f, 0x1f, 0xff, 0xff, 0x1f, 0x1f, 0xff, 0xff, 0x1f, 0x1f, 0xff, 0x1f, 0x1f, 0x0f, 0x0f, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x07, 0x07, 0x0f, 0x0e, 0x0e, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x0e, 0x0e, 0x0f, 0x0f,
0x0f, 0x1f, 0x3c, 0x38, 0x78, 0x70, 0xe0, 0xe0, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0f, 0x0f, 0x0f, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x0e, 0x0c, 0x08, 0x00, 0x00, 0x00
};
const int mh_image_size = sizeof(mh_image);
const bool mh_image_portrait = false;

+ 336
- 0
keyboards/crkbd/keymaps/manna-harbour/readme.org View File

@ -0,0 +1,336 @@
#+Title: Crkbd Keymap by Manna Harbour
[[https://raw.githubusercontent.com/manna-harbour/crkbd/master/crkbd.jpg]]
This keymap includes crkbd-specific hardware feature support. It provides easy
selection of the following:
- hotswap trackpoint module in OLED port, or OLED with new or old drivers
- automatic mouse buttons layer activation on trackpoint movement
- keyboard-side mouse acceleration, or low rates for use with host-side
acceleration
- static image display, or use as caps lock indicator
- built-in logo, or image from data file, with automatic rotation
- automatic conversion of image files
- matrix, light, or underglow RGB
It imports [[https://github.com/manna-harbour/qmk_firmware/blob/miryoku/users/manna-harbour_miryoku/miryoku.org][miryoku]], an ergonomic, minimal, orthogonal layout for ergo or ortho
keyboards.
Please see the [[https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org][development branch]] for any [[https://github.com/qmk/qmk_firmware/compare/master...manna-harbour:crkbd][updates not yet merged into QMK]].
Hotswap trackpoint module hardware details and additional OLED image data files
are provided outside QMK in the [[https://github.com/manna-harbour/crkbd/blob/master/readme.org][Crkbd Keymap by Manna Harbour (Extras)
repository]].
* Contents :TOC:
- [[#features][Features]]
- [[#mh_module][MH_MODULE]]
- [[#mh_auto_buttons][MH_AUTO_BUTTONS]]
- [[#mh_low_mouse][MH_LOW_MOUSE]]
- [[#mh_oled_mode][MH_OLED_MODE]]
- [[#mh_oled_image][MH_OLED_IMAGE]]
- [[#mh_rgb][MH_RGB]]
- [[#user_name][USER_NAME]]
- [[#building-and-flashing][Building and Flashing]]
- [[#sample-configurations][Sample Configurations]]
- [[#setup][Setup]]
- [[#documentation][Documentation]]
- [[#contact][Contact]]
* Features
The following features are provided. They can be selected by editing [[./rules.mk][rules.mk]]
or by [[#sample-configurations][providing options to make when building]]. When enabling multiple features
~LTO_ENABLE=yes~ may be required to reduce firmware size.
Additional configuration options can be configured by editing [[./config.h][config.h]].
** MH_MODULE
Select drivers for the module installed in the OLED socket.
Please note: if module support is enabled in the firmware and flashed to the
keyboard but the module is not physically installed the keyboard will not
operate correctly until the module is installed or correctly configured firmware
is flashed.
*** trackpoint
Enables support for a hotswap trackpoint module installed on the master.
*** oled
Enables OLED support.
Configuration options:
- MH_OLED_TIMEOUT
Fix for lack of OLED timeout on the crkbd. Enabled by default. See [[https://github.com/qmk/qmk_firmware/issues/5982][#5982]].
*** oled_old
Enables OLED support using the old API.
** MH_AUTO_BUTTONS
Automatic mouse buttons layer activation on trackpoint movement.
Requires MH_MODULE=trackpoint (or other PS/2 trackpoint, trackball or trackpad
with PS2_MOUSE_ENABLE).
Configuration options:
- MH_AUTO_BUTTONS_LAYER
Layer to activate on movement.
Provide mousekeys mouse buttons (e.g. on the thumb keys below the
trackpoint).
All other keys should be transparent so that a mousekeys layer can be
activated manually if desired, and normal typing (other than the button
keys) can continue without having to wait for the timeout.
Position the layer in the layer stack for desired precedence.
- MH_AUTO_BUTTONS_TIMEOUT
Time in ms to deactivate layer after last movement.
Timeout will be disabled while a button is held to prevent drags from being
canceled.
If using ~unclutter~, use with the same timeout (e.g. ~unclutter -idle
0.75~) for a visual indication of activation state.
** MH_LOW_MOUSE
Keyboard-side mouse acceleration or low rates for use with host-side
acceleration.
The mousekeys feature has good control over acceleration, however the ps2_mouse
driver only offers the limited acceleration provided by the protocol, and
further increasing speed loses precision.
This option uses low rates and linear response for mouse movement so that
acceleration can be implemented on the host for higher acceleration without loss
of precision. Only a single combined mouse device is seen on the host, so both
mousekeys and ps2_mouse are adjusted.
When enabled, the USB device product name is changed to "Corne Keyboard (crkbd)
with low rate mouse" for matching on the host. E.g. using ~xinput~:
#+BEGIN_SRC sh :tangle no
xinput -set-prop 'pointer:foostan Corne Keyboard (crkbd) with low rate mouse' 'Device Accel Profile' 2
xinput -set-prop 'pointer:foostan Corne Keyboard (crkbd) with low rate mouse' 'Device Accel Velocity Scaling' 10000
#+END_SRC
** MH_OLED_MODE
Selects use of the OLED.
Requires MH_OLED_IMAGE.
*** static
Static image display.
*** caps
Displays image as caps lock indicator.
** MH_OLED_IMAGE
Selects image to display on OLED.
Portrait images will be displayed in portrait orientation. Landscape images
will be displayed with a CCW rotation of 90 degrees on the left and a CW
rotation of 90 degrees on the right.
*** /file.c/
Selects image data file under ~mh_images/converted/~.
Requires MH_MODULE=oled.
Full size QMK and corne logo files are provided.
**** Automatic Conversion
If an image file with the same basename is found under ~mh_images/originals/~,
with resolution 128x32 or 32x128, it will be automatically converted to an image
data file under ~mh_images/converted/~.
Requires ~convert~ (ImageMagick) and ~xxd~ (vim).
*** logo
Logo included in default OLED font.
Requires MH_MODULE=oled (QMK logo) or MH_MODULE=oled_old (corne logo).
** MH_RGB
Selects drivers and configuration for RGB.
*** matrix
Selects RGB Matrix driver.
Configuration options:
- MH_RGB_TOGGLE_OFF
Work-around for RGB sync issue on the crkbd and lack of RGB_OFF keycode.
Occasionally when flashing RGB firmware to the crkbd the on / off state will
be out of sync between halves. Use shift-RGB_TOG to turn RGB off on both
halves. Enabled by default. See [[https://github.com/qmk/qmk_firmware/issues/6594][#6594]] and [[https://github.com/qmk/qmk_firmware/pull/5998][#5998]].
*** light
Selects RGB Light driver.
*** underglow
Select RGB Light driver and enables only the bottom-facing LEDs.
** USER_NAME
This keymap (customised QMK configuration for an individual keyboard and user)
does not contain a keymap (mapping of keys to keycodes), which is imported from
elsewhere.
This feature can be used to select the imported keymap. See the miryoku
userspace for reference, but test for the KEYBOARD_crkbd macro and use the crkbd
LAYOUT.
* Building and Flashing
** Sample Configurations
#+BEGIN_SRC sh :tangle no
# Hotswap PS/2 trackpoint module installed in the OLED socket. Master side only.
make crkbd:manna-harbour:flash MH_MODULE=trackpoint
# As above with automatic mouse buttons layer activation on trackpoint movement.
make crkbd:manna-harbour:flash MH_MODULE=trackpoint MH_AUTO_BUTTONS=yes
# As above with low mouse movement rates for acceleration on the host.
make crkbd:manna-harbour:flash MH_MODULE=trackpoint MH_AUTO_BUTTONS=yes MH_LOW_MOUSE=yes
# OLED with static image from image data file mh_images/converted/qmk.c.
make crkbd:manna-harbour:flash MH_MODULE=oled MH_OLED_MODE=static MH_OLED_IMAGE=qmk.c
# As above but with automatic convertion from mh_images/originals/image.*.
make crkbd:manna-harbour:flash MH_MODULE=oled MH_OLED_MODE=static MH_OLED_IMAGE=image.c
# OLED with image display as caps lock indicator. Master side only.
make crkbd:manna-harbour:flash MH_MODULE=oled MH_OLED_MODE=caps MH_OLED_IMAGE=qmk.c
# OLED with static built-in logo image (qmk logo).
make crkbd:manna-harbour:flash MH_MODULE=oled MH_OLED_MODE=static MH_OLED_IMAGE=logo
# As above but with old driver (corne logo).
make crkbd:manna-harbour:flash MH_MODULE=oled_old MH_OLED_MODE=static MH_OLED_IMAGE=logo
# As above but with image display as caps lock indicator. Master side only.
make crkbd:manna-harbour:flash MH_MODULE=oled_old MH_OLED_MODE=caps MH_OLED_IMAGE=logo
# RGB matrix.
make crkbd:manna-harbour:flash MH_MODULE=no MH_RGB=matrix
# RGB light.
make crkbd:manna-harbour:flash MH_MODULE=no MH_RGB=light
# As above but bottom-facing LEDs only.
make crkbd:manna-harbour:flash MH_MODULE=no MH_RGB=underglow
# Change miryoku alphas
make crkbd:manna-harbour:flash MIRYOKU_ALPHAS=QWERTY
# Use keymap from users/user
make crkbd:manna-harbour:flash USER_NAME=user
# Trackpoint, automatic mouse button layer, RGB matrix, LTO to reduce firmware size. Master side only.
make crkbd:manna-harbour:flash MH_MODULE=trackpoint MH_AUTO_BUTTONS=yes MH_RGB=matrix LTO_ENABLE=yes
# OLED with static image, RGB matrix, LTO to reduce firmware size
make crkbd:manna-harbour:flash MH_MODULE=oled MH_OLED_MODE=static MH_OLED_IMAGE=qmk.c MH_RGB=matrix LTO_ENABLE=yes
#+END_SRC
** Setup
*** Erase
#+BEGIN_SRC sh :tangle no
avrdude -p m32U4 -P /dev/ttyACM0 -c avr109 -e
#+END_SRC
*** Set Handedness for EE_HANDS
#+BEGIN_SRC sh :tangle no
make crkbd:manna-harbour:avrdude-split-left # left
make crkbd:manna-harbour:avrdude-split-right # right
#+END_SRC
*** Build
#+BEGIN_SRC sh :tangle no
make crkbd:manna-harbour
#+END_SRC
*** Build and Flash
#+BEGIN_SRC sh :tangle no
make crkbd:manna-harbour:flash
#+END_SRC
* Documentation
- https://docs.qmk.fm/#/custom_quantum_functions
- https://docs.qmk.fm/#/feature_layers
- https://docs.qmk.fm/#/feature_mouse_keys
- https://docs.qmk.fm/#/feature_oled_driver
- https://docs.qmk.fm/#/feature_ps2_mouse
- https://docs.qmk.fm/#/feature_split_keyboard
- https://docs.qmk.fm/#/feature_userspace
- https://docs.qmk.fm/#/flashing
- https://docs.qmk.fm/#/newbs_testing_debugging
- https://docs.qmk.fm/#/understanding_qmk
- https://imagemagick.org/script/formats.php
* Contact
For issues with this branch, please [[https://github.com/manna-harbour/qmk_firmware/issues/new][open an issue]].
For more general discussion, please join a recent relevant [[https://www.reddit.com/user/manna_harbour/][thread]] or [[https://www.reddit.com/message/compose/?to=manna_harbour][send a PM]].
[[https://github.com/manna-harbour][https://raw.githubusercontent.com/manna-harbour/crkbd/master/manna-harbour-boa-32.png]]

+ 100
- 0
keyboards/crkbd/keymaps/manna-harbour/rules.mk View File

@ -0,0 +1,100 @@
## https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org
#MH_MODULE=trackpoint
#MH_MODULE=oled
#MH_MODULE=oled_old
MH_MODULE=no
#MH_AUTO_BUTTONS=yes
MH_AUTO_BUTTONS=no
#MH_LOW_MOUSE=yes
MH_LOW_MOUSE=no
#MH_OLED_MODE=static
#MH_OLED_MODE=caps
MH_OLED_MODE=no
#MH_OLED_IMAGE=qmk.c
#MH_OLED_IMAGE=image.c
#MH_OLED_IMAGE=logo
MH_OLED_IMAGE=no
#MH_RGB=matrix
#MH_RGB=backlight
#MH_RGB=underglow
MH_RGB=no
#MH_DEBUG=yes
MH_DEBUG=no
#LTO_ENABLE=yes
LTO_ENABLE=no
## rules.mk, config.h, manna-harbour_miryoku.h, manna-harbour_miryoku.c
USER_NAME := manna-harbour_miryoku
this_dir=keyboards/crkbd/keymaps/manna-harbour
OPT_DEFS += -DMH_USER_NAME_H=\"$(USER_NAME).h\"
ifeq ($(strip $(MH_MODULE)), trackpoint)
PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes
OPT_DEFS += -DMH_MODULE_TRACKPOINT
else ifeq ($(strip $(MH_MODULE)), oled)
OLED_DRIVER_ENABLE = yes
else ifeq ($(strip $(MH_MODULE)), oled_old)
SRC += ./lib/glcdfont.c
SRC += ./lib/logo_reader.c
OPT_DEFS += -DSSD1306OLED
endif
ifeq ($(strip $(MH_AUTO_BUTTONS)), yes)
MOUSEKEY_ENABLE = yes
OPT_DEFS += -DMH_AUTO_BUTTONS
endif
ifeq ($(strip $(MH_LOW_MOUSE)), yes)
OPT_DEFS += -DMH_LOW_MOUSE
endif
ifeq ($(strip $(MH_OLED_MODE)), static)
OPT_DEFS += -DMH_OLED_MODE_STATIC
else ifeq ($(strip $(MH_OLED_MODE)), caps)
OPT_DEFS += -DMH_OLED_MODE_CAPS
endif
images=$(this_dir)/mh_images
originals=$(images)/originals
converted=$(images)/converted
$(converted)/%.c: $(originals)/%.*
$(this_dir)/mh_image_to_oled $< > $@
ifeq ($(strip $(MH_OLED_IMAGE)), logo)
OPT_DEFS += -DMH_OLED_IMAGE_LOGO
else ifneq ($(strip $(MH_OLED_IMAGE)), )
ifneq ($(strip $(MH_OLED_IMAGE)), no)
OPT_DEFS += -DMH_OLED_IMAGE_FILE
ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
SRC += $(converted)/$(MH_OLED_IMAGE)
endif
endif
endif
ifeq ($(strip $(MH_RGB)), matrix)
RGB_MATRIX_ENABLE = WS2812
else ifeq ($(strip $(MH_RGB)), light)
RGBLIGHT_ENABLE = yes
else ifeq ($(strip $(MH_RGB)), underglow)
RGBLIGHT_ENABLE = yes
OPT_DEFS += -DMH_RGB_UNDERGLOW
endif
ifeq ($(strip $(MH_DEBUG)), yes)
CONSOLE_ENABLE=yes
OPT_DEFS += -DMH_DEBUG
endif

Loading…
Cancel
Save