Skip to content

Commit

Permalink
merging mouse and keyboard part1
Browse files Browse the repository at this point in the history
  • Loading branch information
l3ztum committed May 4, 2023
1 parent a99f7ee commit 215bf77
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 33 deletions.
1 change: 0 additions & 1 deletion builddefs/common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,6 @@ ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes)
MOUSE_ENABLE := yes
SRC += ps2_mouse.c
OPT_DEFS += -DPS2_MOUSE_ENABLE
OPT_DEFS += -DMOUSE_ENABLE
endif

VALID_PS2_DRIVER_TYPES := busywait interrupt usart vendor
Expand Down
3 changes: 2 additions & 1 deletion keyboards/l3ztum/lotus58/bongo.h
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ static void draw_bongo(bool minimal)


oled_set_cursor(0, 2);
switch (get_highest_layer(default_layer_state)) {

switch (get_highest_layer(layer_state|default_layer_state)) {
case 0:
oled_write_P(PSTR("L-Base"), false);
break;
Expand Down
2 changes: 2 additions & 0 deletions keyboards/l3ztum/lotus58/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
#define SPLIT_LED_STATE_ENABLE
#define SPLIT_OLED_ENABLE

#define PS2_CLOCK_PIN B0
#define PS2_DATA_PIN D5
4 changes: 2 additions & 2 deletions keyboards/l3ztum/lotus58/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"console": false,
"extrakey": true,
"mousekey": true,
"encoder": false,
"encoder_map": false,
"encoder": true,
"encoder_map": true,
"nkro": true,
"rgblight": true,
"oled": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
#define XXX KC_NO
#define COMBO_COUNT 4


#define LAYOUT_split_3x5_3( \
L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \
L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \
L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \
L30, L31, L32, R30, R31, R32 \
) \
{ \
{ KC_1, KC_1, KC_2, KC_3, KC_4, KC_5 }, \
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5 }, \
{ KC_TAB, L00, L01, L02, L03, L04 }, \
{ KC_LSFT, L10, L11, L12, L13, L14 }, \
{ KC_LCTL, L20, L21, L22, L23, L24 }, \
Expand Down
15 changes: 15 additions & 0 deletions keyboards/l3ztum/lotus58/keymaps/manna-harbour_miryoku/keymap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// Copyright 2019 Manna Harbour
// https://github.com/manna-harbour/miryoku

#include QMK_KEYBOARD_H

// 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/>.
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[0] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP) },//base
[1] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP),},//extra
[2] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP),},//tap
[3] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP), },//button
[4] = { ENCODER_CCW_CW(RGB_SPD, RGB_SPI), },//nav
[5] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP), },//mouse
[6] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), },//media
[7] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP), },//num
[8] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP), },//sys
[9] = { ENCODER_CCW_CW(KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP), }//fun
};
#endif
6 changes: 6 additions & 0 deletions keyboards/l3ztum/lotus58/rgb_full/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ WPM_ENABLE = yes
KEY_OVERRIDE_ENABLE = yes
UNICODE_ENABLE = yes
COMBO_ENABLE = yes

PS2_MOUSE_ENABLE = yes
PS2_USE_WAIT = yes
PS2_ENABLE = yes

PS2_DRIVER = interrupt
78 changes: 50 additions & 28 deletions users/manna-harbour_miryoku/german_umlaut.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,95 +14,117 @@ enum custom_keycodes {
bool is_alt_tab_active = false; // ADD this near the beginning of keymap.c
uint16_t alt_tab_timer = 0; // we will be using them soon.


void turn_on_num_lock(void)
{
if (!(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK))) {
register_code(KC_NUM_LOCK);
unregister_code(KC_NUM_LOCK);
send_keyboard_report();
}
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case DE_AE:
if (record->event.pressed) {
uint8_t temp_mod = get_mods();
turn_on_num_lock();
clear_keyboard();
register_code(KC_LALT);
send_keyboard_report();
if (temp_mod & MOD_MASK_SHIFT) {
tap_code(KC_P1); tap_code(KC_P4); tap_code(KC_P2); // Ä
tap_code(KC_KP_1); tap_code(KC_KP_4); tap_code(KC_KP_2); // Ä
} else {
tap_code(KC_P1); tap_code(KC_P3); tap_code(KC_P2); // ä
tap_code(KC_KP_1); tap_code(KC_KP_3); tap_code(KC_KP_2); // ä
}
unregister_code(KC_LALT);
send_keyboard_report();
return false;
}
break;
case DE_UE:
if (record->event.pressed) {
uint8_t temp_mod = get_mods();
turn_on_num_lock();
clear_keyboard();
register_code(KC_LALT);
send_keyboard_report();
if (temp_mod & MOD_MASK_SHIFT) {
tap_code(KC_P1); tap_code(KC_P5); tap_code(KC_P4); // Ä
tap_code(KC_KP_1); tap_code(KC_KP_5); tap_code(KC_KP_4); // Ü
} else {
tap_code(KC_P1); tap_code(KC_P2); tap_code(KC_P9); // ä
tap_code(KC_KP_1); tap_code(KC_KP_2); tap_code(KC_KP_9); // ü
}
unregister_code(KC_LALT);
send_keyboard_report();
return false;
}
break;
case DE_OE:
if (record->event.pressed) {
uint8_t temp_mod = get_mods();
turn_on_num_lock();
clear_keyboard();
register_code(KC_LALT);
send_keyboard_report();
if (temp_mod & MOD_MASK_SHIFT) {
tap_code(KC_P1); tap_code(KC_P5); tap_code(KC_P3); // Ä
tap_code(KC_KP_1); tap_code(KC_KP_5); tap_code(KC_KP_3); // Ö
} else {
tap_code(KC_P1); tap_code(KC_P4); tap_code(KC_P8); // ä
tap_code(KC_KP_1); tap_code(KC_KP_4); tap_code(KC_KP_8); // ö
}
unregister_code(KC_LALT);
send_keyboard_report();
return false;
}
break;
case DE_SZ:
if (record->event.pressed) {
turn_on_num_lock();
send_keyboard_report();
clear_keyboard();
register_code(KC_LALT);
tap_code(KC_P2); tap_code(KC_P2); tap_code(KC_P5); // sz
send_keyboard_report();
tap_code(KC_KP_2); tap_code(KC_KP_2); tap_code(KC_KP_5); // ß
unregister_code(KC_LALT);
send_keyboard_report();
return false;
}
break;
case BASH_UPWARD:
if (record->event.pressed) {
SEND_STRING("../");
return false;
}
break;
case CPP_SCOPE:
if (record->event.pressed) {
SEND_STRING("::");
return false;
}
break;
case ALT_TAB:
if (record->event.pressed) {
if (!is_alt_tab_active) {
is_alt_tab_active = true;
register_code(KC_LALT);
}
alt_tab_timer = timer_read();
register_code(KC_TAB);
} else {
unregister_code(KC_TAB);
}
break;
// case ALT_TAB:
// if (record->event.pressed) {
// if (!is_alt_tab_active) {
// is_alt_tab_active = true;
// register_code(KC_LALT);
// }
// alt_tab_timer = timer_read();
// register_code(KC_TAB);
// } else {
// unregister_code(KC_TAB);
// }
// break;
}
return true;
}

void matrix_scan_user(void) { // The very important timer.
if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 1000) {
unregister_code(KC_LALT);
is_alt_tab_active = false;
}
}
}
// void matrix_scan_user(void) { // The very important timer.
// if (is_alt_tab_active) {
// if (timer_elapsed(alt_tab_timer) > 1000) {
// unregister_code(KC_LALT);
// is_alt_tab_active = false;
// }
// }
// }

const uint16_t PROGMEM ae_combo[] = {LGUI_T(KC_A), LALT_T(KC_S), COMBO_END};
const uint16_t PROGMEM oe_combo[] = {KC_O, KC_I, COMBO_END};
Expand Down

0 comments on commit 215bf77

Please sign in to comment.