summaryrefslogtreecommitdiff
path: root/keyboards/draculad/keymaps/pimoroni/keymap.c
diff options
context:
space:
mode:
authorMango The Fourth <40720523+MangoIV@users.noreply.github.com>2022-01-03 01:20:24 +0100
committerGitHub <noreply@github.com>2022-01-03 00:20:24 +0000
commit838b214a2e4d791479a4ce67e508576293202516 (patch)
treeb154375ebb0e03dbc789fede8087310ca4a43c94 /keyboards/draculad/keymaps/pimoroni/keymap.c
parent6f043c549715b572cb77015369d07b382887daba (diff)
Fix DracuLad keymap to accomodate for breaking changes. (#15713)
Co-authored-by: MangoIV <mangoiv@outlook.com>
Diffstat (limited to 'keyboards/draculad/keymaps/pimoroni/keymap.c')
-rw-r--r--keyboards/draculad/keymaps/pimoroni/keymap.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/keyboards/draculad/keymaps/pimoroni/keymap.c b/keyboards/draculad/keymaps/pimoroni/keymap.c
index b70184dbc8..5c20c69af9 100644
--- a/keyboards/draculad/keymaps/pimoroni/keymap.c
+++ b/keyboards/draculad/keymaps/pimoroni/keymap.c
@@ -16,8 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
-#include "drivers/sensors/pimoroni_trackball.h"
-#include "pointing_device.h"
enum layer_number {
@@ -29,13 +27,13 @@ enum layer_number {
};
enum custom_keycodes {
- BALL_HUI,//cycles hue
- BALL_WHT,//cycles white
- BALL_DEC,//decreased color
- BALL_SCR,//scrolls
- BALL_NCL,//left click
- BALL_RCL,//right click
- BALL_MCL,//middle click
+ BALL_HUI = SAFE_RANGE, //cycles hue
+ BALL_WHT, //cycles white
+ BALL_DEC, //decreased color
+ BALL_SCR, //scrolls
+ BALL_NCL, //left click
+ BALL_RCL, //right click
+ BALL_MCL, //middle click
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -78,8 +76,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef OLED_ENABLE
-
-
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
if (is_keyboard_master()) {
@@ -209,13 +205,23 @@ bool oled_task_user(void) {
return false;
}
-#endif
+#endif //OLED_ENABLE
uint8_t white = 0;
uint8_t red = 255;
uint8_t green = 0;
uint8_t blue = 0;
+bool set_scrolling = false;
+report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
+ if (set_scrolling) {
+ mouse_report.h = mouse_report.x;
+ mouse_report.v = mouse_report.y;
+ mouse_report.x = mouse_report.y = 0;
+ }
+ return mouse_report;
+}
+
void ball_increase_hue(void){
if(red!=255&&green!=255&&blue!=255){
red =255;
@@ -233,7 +239,7 @@ void ball_increase_hue(void){
} else if(green ==0&&blue>0&&red==255){
blue -=15;
}
- trackball_set_rgbw(red,green,blue,white);
+ pimoroni_trackball_set_rgbw(red,green,blue,white);
}
void decrease_color(void){
@@ -246,7 +252,7 @@ void decrease_color(void){
if (blue>0){
blue-=15;
}
- trackball_set_rgbw(red,green,blue,white);
+ pimoroni_trackball_set_rgbw(red,green,blue,white);
}
void cycle_white(void){
@@ -255,7 +261,7 @@ void cycle_white(void){
} else{
white=0;
}
- trackball_set_rgbw(red,green,blue,white);
+ pimoroni_trackball_set_rgbw(red,green,blue,white);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record){
@@ -280,9 +286,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record){
case BALL_SCR:
if(record->event.pressed){
- trackball_set_scrolling(true);
+ set_scrolling = true;
} else{
- trackball_set_scrolling(false);
+ set_scrolling = false;
}
break;
@@ -298,6 +304,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record){
}
return true;
}
+
#ifdef ENCODER_ENABLE
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
@@ -325,4 +332,4 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
// the missing ones are encoder 1 on the right side and encoder 3 on the left side
return true;
}
-#endif
+#endif // ENCODER_ENABLE