Skip to content

Commit

Permalink
Add cornia keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaarai committed Sep 26, 2024
1 parent 805cde6 commit 15dc389
Show file tree
Hide file tree
Showing 21 changed files with 1,143 additions and 0 deletions.
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
}
}
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)

/* 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
//`--------------------------' `--------------------------'
),

[_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, _______,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______,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,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______, _______
//`--------------------------' `--------------------------'
),
};
32 changes: 32 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_oled.c
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);
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
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;
}
45 changes: 45 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_record.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* 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"

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;
}
return true;
}
25 changes: 25 additions & 0 deletions keyboards/cornia/keymaps/fire/callback_system.c
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

/* 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 */
#define SPLIT_POINTING_ENABLE
#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
Loading

0 comments on commit 15dc389

Please sign in to comment.