#Meishi Trackball Module: Rotary Encoder acting as volume knob

24 messages · Page 1 of 1 (latest)

craggy dock
#

Hi everyone, I'm having some trouble with the meishi trackball module I've flashed it and it works and everything but I'm trying to make it so the rotary encoder works as scroll wheel it currently is acting like a volume knob. I'm trying to use VIA or REMAP but I can't seem to get it to work.Also been trying qmk toolbox but I keep getting errors. I've looked for help on r/trackballs and I was pointed to the qmk discord

This is the Trackball module, https://github.com/aki27kbd/trackball_module

Here is the firmware, https://github.com/aki27kbd/qmk_firmware/tree/master/keyboards/aki27/trackball_module

If anyone can help me that would be amazing 🥺🥺🥺

GitHub

34mm trackball module with ADNS-5050 sensor. This module can be implemented with existing DIY keyboards via wiring. - aki27kbd/trackball_module

GitHub

Open-source keyboard firmware for Atmel AVR and Arm USB families - aki27kbd/qmk_firmware

sweet yacht
#

it's just an encoder, so you'd just need to change the keycodes for the encoder map

#

if you're compiling from qmk directly, MS_WHLU and MS_WHLD are the keycodes you want

craggy dock
#

#include QMK_KEYBOARD_H
#include <stdio.h>
#include "quantum.h"

// Defines names for use in layer keycodes and the keymap
enum layer_number {
_BASE = 0,
_LOWER = 1,
_RAISE = 2,
_TRACKBALL = 3
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
MS_BTN1, MS_BTN2, MS_BTN3
),
[_LOWER] = LAYOUT(
KC_A, KC_B, KC_C
),
[_RAISE] = LAYOUT(
KC_A, KC_B, KC_C
),
[_TRACKBALL] = LAYOUT(
KC_A, KC_B, KC_C
)
};

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD) },
[1] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD) },
[2] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD) },
[3] = { ENCODER_CCW_CW(MS_WHLU, MS_WHLD) },
};
#endif

layer_state_t layer_state_set_user(layer_state_t state) {

switch (get_highest_layer(state)) {
case _LOWER:
case _RAISE:
    cocot_set_scroll_mode(true);
    break;
case _TRACKBALL:
    cocot_set_scroll_mode(false);
    break;
default:
    cocot_set_scroll_mode(false);
    break;
}

return state;
};

#ifdef OLED_ENABLE
bool oled_task_user(void) {
oled_write_layer_state();
return false;
}
#endif
Just tried this out, it stop acting as a volume knob but it doesn't scroll
This is what im using right now is there any other changes that should be changed?

#

VIA_ENABLE = yes
ENCODER_ENABLE = yes
ENCODER_MAP_ENABLE = yes
Also this my rules.mk

sweet yacht
#

Make sure you have MOUSEKEY_ENABLE = yes

#

also, don't change all of the layers for it?

#

just the one you want/need

craggy dock
#

added MOUSEKEY_ENABLE = yes and still no scroll function

sweet yacht
#

disable via, or reset the eeprom after reflashing

#

when via is enabled, the keymap is stored and read from eeprom. This means that any changes you make are NOT applied until you force read them out into eeprom (by resetting eeprom, or using remap's "load default" option)

#

and this includes the encoder map stuff too

craggy dock
#

So delete the VIA_ENABLE = yes?

sweet yacht
#

yeah

craggy dock
#

OMG it works thank you so much 🫶🫶🫶

sweet yacht
#

glad to hear it!

#

via(l) is great when you're learning the board, but if you're compiling code, then you're kinda past that point, and is worth just ditching via(l)

#

you may also want to consider updating your repo (or basically grab the keyboard files, and copy them to an updated version of the repo)

#

namely, for community module support

#

I have a few that you may want to check out 😉

craggy dock