Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cornia keyboard #24442

Merged
merged 15 commits into from
Dec 3, 2024
Merged
11 changes: 11 additions & 0 deletions keyboards/cornia/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"manufacturer": "Vaarai",
"maintainer": "Vaarai",
"url": "https://github.com/Vaarai/Cornia",
"usb": {
"vid": "0xFEED"
},
"split": {
"enabled": true
}
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
}
83 changes: 83 additions & 0 deletions keyboards/cornia/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

/* Custom Keycodes (CK_xxx) */
#define CK_LPAR LSFT(KC_9)
#define CK_RPAR LSFT(KC_0)
#define CK_LCBR LSFT(KC_LBRC)
#define CK_RCBR LSFT(KC_RBRC)
#define CK_QMRK LSFT(KC_SLSH)
#define CK_UNSC LSFT(KC_MINS)
Vaarai marked this conversation as resolved.
Show resolved Hide resolved

/* Layers definitions */
enum layers {
_ALPHA,
_NAV,
_NUM,
_ADJUST,
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ALPHA] = LAYOUT_split_3x6_3(
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RCTL,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LSFT,MO(_NAV), KC_SPC, KC_ENT,MO(_NUM), KC_RSFT
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
//`--------------------------' `--------------------------'
),

[_NAV] = LAYOUT_split_3x6_3(
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_RALT,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, _______, _______, _______,MO(_ADJUST),_______
//`--------------------------' `--------------------------'
),

[_NUM] = LAYOUT_split_3x6_3(
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, KC_SLSH, CK_LCBR, CK_LPAR, KC_LBRC, KC_MINS, CK_UNSC, KC_RBRC, CK_RPAR, CK_RCBR, KC_BSLS, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
_______, XXXXXXX, KC_GRV, CK_QMRK, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______,
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______,MO(_ADJUST),_______, _______, _______, KC_RGUI
//`--------------------------' `--------------------------'
),

[_ADJUST] = LAYOUT_split_3x6_3(
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, RGB_TOG, RGB_HUI, RGB_VAI, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
//|--------+--------+--------+--------+--------|--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, RGB_MOD, RGB_HUD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
//`--------------------------' `--------------------------'
),
};
32 changes: 32 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_oled.c
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#include "./keymap.h"
#include "./oled_routines.h"

oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_270;
}

bool oled_task_user(void) {
oled_set_cursor(0, 0);
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
render_logo();
oled_set_cursor(0, 7);
render_layer_status();
return false;
}
51 changes: 51 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_pointing_device.c
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#include "./keymap.h"

/* Trackpad srolling speed adjustment */
#define SCROLL_DIVISOR_H 8.0
#define SCROLL_DIVISOR_V 8.0

bool set_scrolling = false;

/* Variables to store accumulated scroll values */
float scroll_accumulated_h = 0;
float scroll_accumulated_v = 0;

report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
/* Check if drag scrolling is active */
if (set_scrolling) {
/* Calculate and accumulate scroll values based on mouse movement and divisors */
scroll_accumulated_h += (float)mouse_report.x / SCROLL_DIVISOR_H;
scroll_accumulated_v += (float)mouse_report.y / SCROLL_DIVISOR_V;

/* Assign integer parts of accumulated scroll values to the mouse report */
mouse_report.h = (int8_t)scroll_accumulated_h;
mouse_report.v = (int8_t)scroll_accumulated_v;

/* Update accumulated scroll values by subtracting the integer parts */
scroll_accumulated_h -= (int8_t)scroll_accumulated_h;
scroll_accumulated_v -= (int8_t)scroll_accumulated_v;

/* Clear the X and Y values of the mouse report */
mouse_report.x = 0;
mouse_report.y = 0;
}
return mouse_report;
}
75 changes: 75 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_record.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#include "./keymap.h"
#include "./tap_dances.h"

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case CK_RKJMP: /* Warframe rocket jump */
if (record->event.pressed) {
SEND_STRING(SS_DOWN(X_C));
} else {
SEND_STRING(SS_DOWN(X_SPC) SS_DELAY(50) SS_UP(X_C) SS_DELAY(50) SS_UP(X_SPC));
}
return false;
case CK_DPII: /* Increase trackpad DPI */
if (record->event.pressed) {
pointing_device_set_cpi(pointing_device_get_cpi()+100);
}
return false;
case CK_DPID: /* Decrease trackpad DPI */
if (record->event.pressed) {
pointing_device_set_cpi(pointing_device_get_cpi()-100);
}
return false;
case CK_SCRL: /* Toggle set_scrolling when CK_SCRL key is pressed or released */
set_scrolling = record->event.pressed;
return false;
}
/* Accented letters */
if (accent_state != ACCENT_NONE && record->event.pressed)
{
switch (keycode) {
case KC_A:
SEND_STRING(SS_ACCENT_A_GRAVE);
return false;
case KC_C:
SEND_STRING(SS_ACCENT_C_CEDIL);
return false;
case KC_E:
switch (accent_state) {
case ACCENT_LEFT:
SEND_STRING(SS_ACCENT_E_ACUTE); break;
case ACCENT_RIGHT:
SEND_STRING(SS_ACCENT_E_GRAVE); break;
case ACCENT_NONE:
break;
}
return false;
case KC_O:
SEND_STRING(SS_ACCENT_O_CIRCU);
return false;
case KC_U:
SEND_STRING(SS_ACCENT_U_GRAVE);
return false;
}
accent_state = ACCENT_NONE;
}
return true;
}
25 changes: 25 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_system.c
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include QMK_KEYBOARD_H

#include "./keymap.h"
#include "./oled_routines.h"

bool shutdown_user(bool jump_to_bootloader) {
render_boot(jump_to_bootloader);
return false;
}
44 changes: 44 additions & 0 deletions keyboards/cornia/keymaps/fire/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright 2024 Vaarai
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

/* I²C config */
#define I2C_DRIVER I2CD1
#define I2C1_SDA_PIN GP10
#define I2C1_SCL_PIN GP11
Vaarai marked this conversation as resolved.
Show resolved Hide resolved

/* Split */
#define SPLIT_ACTIVITY_ENABLE
#define SPLIT_LAYER_STATE_ENABLE
#define SPLIT_LED_STATE_ENABLE
#define SPLIT_MODS_ENABLE

/* OLED */
#define OLED_TIMEOUT 60000

/* Trackpad */
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
#define SPLIT_POINTING_ENABLE
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
#define POINTING_DEVICE_RIGHT
#define POINTING_DEVICE_ROTATION_90
#define CIRQUE_PINNACLE_DIAMETER_MM 40
#define CIRQUE_PINNACLE_TAP_ENABLE
#define CIRQUE_PINNACLE_CURVED_OVERLAY
#define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_RELATIVE_MODE
#define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X

/* Tap dance */
#define TAPPING_TERM 200
Vaarai marked this conversation as resolved.
Show resolved Hide resolved
Loading