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

New scroll snap methods and hooks to full customization #560

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[3] = LAYOUT_universal(
RGB_TOG , AML_TO , AML_I50 , AML_D50 , _______ , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , RGB_M_SN ,
RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , SCRL_DVI , RGB_M_K , RGB_M_X , RGB_M_G , RGB_M_T , RGB_M_TW ,
RGB_TOG , AML_TO , AML_I50 , AML_D50 , _______ , _______ , _______ , SSNP_HOR , SSNP_VRT , SSNP_FRE ,
RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , SCRL_DVI , _______ , _______ , _______ , _______ , _______ ,
RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , SCRL_DVD , CPI_D1K , CPI_D100 , CPI_I100 , CPI_I1K , KBC_SAVE ,
QK_BOOT , KBC_RST , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , KBC_RST , QK_BOOT
),
Expand Down
4 changes: 2 additions & 2 deletions qmk_firmware/keyboards/keyball/keyball39/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[3] = LAYOUT_universal(
RGB_TOG , AML_TO , AML_I50 , AML_D50 , _______ , RGB_M_P , RGB_M_B , RGB_M_R , RGB_M_SW , RGB_M_SN ,
RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , SCRL_DVI , RGB_M_K , RGB_M_X , RGB_M_G , RGB_M_T , RGB_M_TW ,
RGB_TOG , AML_TO , AML_I50 , AML_D50 , _______ , _______ , _______ , SSNP_HOR , SSNP_VRT , SSNP_FRE ,
RGB_MOD , RGB_HUI , RGB_SAI , RGB_VAI , SCRL_DVI , _______ , _______ , _______ , _______ , _______ ,
RGB_RMOD , RGB_HUD , RGB_SAD , RGB_VAD , SCRL_DVD , CPI_D1K , CPI_D100 , CPI_I100 , CPI_I1K , KBC_SAVE ,
QK_BOOT , KBC_RST , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , KBC_RST , QK_BOOT
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_DEL ,
KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , S(KC_7) ,
KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_INT1 ,
KC_LALT,KC_LGUI,LCTL_T(KC_LNG2) ,LT(1,KC_SPC),LT(3,KC_LNG2), KC_BSPC,LT(2,KC_ENT), RCTL_T(KC_LNG2), KC_RALT , KC_PSCR
KC_LALT,KC_LGUI,LCTL_T(KC_LNG2) ,LT(1,KC_SPC),LT(3,KC_LNG1), KC_BSPC,LT(2,KC_ENT), RCTL_T(KC_LNG2), KC_RALT , KC_PSCR
),

[1] = LAYOUT_universal(
_______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
_______ , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 ,
_______ , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ ,
SSNP_FRE , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
SSNP_VRT , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 ,
SSNP_HOR , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ ,
_______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______
),

Expand Down
6 changes: 3 additions & 3 deletions qmk_firmware/keyboards/keyball/keyball44/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[1] = LAYOUT_universal(
_______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
_______ , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 ,
_______ , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ ,
SSNP_FRE , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
SSNP_VRT , _______ , _______ , KC_UP , KC_ENT , KC_DEL , KC_PGUP , KC_BTN1 , KC_UP , KC_BTN2 , KC_BTN3 , KC_F12 ,
SSNP_HOR , _______ , KC_LEFT , KC_DOWN , KC_RGHT , KC_BSPC , KC_PGDN , KC_LEFT , KC_DOWN , KC_RGHT , _______ , _______ ,
_______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BALL] = LAYOUT_right_ball(
//,-----------------------------------------------------. ,-----------------------------------------------------.
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K,
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, _______, _______, _______,SSNP_HOR,SSNP_VRT,SSNP_FRE,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, RGB_M_X, RGB_M_G, RGB_M_T,RGB_M_TW, _______, _______,
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------' |--------+--------+--------+--------+--------+--------|
RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, CPI_D1K,CPI_D100,CPI_I100, CPI_I1K,KBC_SAVE,
//|--------+--------+--------+--------+--------+-------+--------. `--------+--------+--------+--------+--------+--------|
Expand Down
4 changes: 2 additions & 2 deletions qmk_firmware/keyboards/keyball/keyball46/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BALL] = LAYOUT_right_ball(
//,-----------------------------------------------------. ,-----------------------------------------------------.
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K,
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, _______, _______, _______,SSNP_HOR,SSNP_VRT,SSNP_FRE,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, RGB_M_X, RGB_M_G, RGB_M_T,RGB_M_TW, _______, _______,
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------' |--------+--------+--------+--------+--------+--------|
RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, CPI_D1K,CPI_D100,CPI_I100, CPI_I1K,KBC_SAVE,
//|--------+--------+--------+--------+--------+-------+--------. `--------+--------+--------+--------+--------+--------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BALL] = LAYOUT_double_balls(
//,-----------------------------------------------------. ,-----------------------------------------------------.
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K,
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, _______, _______, _______,SSNP_HOR,SSNP_VRT,SSNP_FRE,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, RGB_M_X, RGB_M_G, RGB_M_T,RGB_M_TW, _______, _______,
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, CPI_D1K,CPI_D100,CPI_I100, CPI_I1K,KBC_SAVE,
//|--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_BALL] = LAYOUT_left_ball(
//,-----------------------------------------------------. ,-----------------------------------------------------.
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, RGB_M_P, RGB_M_B, RGB_M_R,RGB_M_SW,RGB_M_SN, RGB_M_K,
RGB_TOG, AML_TO , AML_I50, AML_D50, _______, _______, _______, _______, _______,SSNP_HOR,SSNP_VRT,SSNP_FRE,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, RGB_M_X, RGB_M_G, RGB_M_T,RGB_M_TW, _______, _______,
RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------| `--------+--------+--------+--------+--------+--------|
RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, CPI_D1K,CPI_D100,CPI_I100, CPI_I1K,KBC_SAVE,
//|--------+--------+--------+--------+--------+--------' ,--------+-------+--------+--------+--------+--------+--------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[2] = LAYOUT_universal(
_______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
_______ , _______ , KC_7 , KC_8 , KC_9 , _______ , _______ , KC_LEFT , KC_UP , KC_RGHT , _______ , KC_F12 ,
_______ , _______ , KC_4 , KC_5 , KC_6 ,S(KC_SCLN), KC_PGUP , KC_BTN1 , KC_DOWN , KC_BTN2 , KC_BTN3 , _______ ,
SSNP_FRE , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
SSNP_VRT , _______ , KC_7 , KC_8 , KC_9 , _______ , _______ , KC_LEFT , KC_UP , KC_RGHT , _______ , KC_F12 ,
SSNP_HOR , _______ , KC_4 , KC_5 , KC_6 ,S(KC_SCLN), KC_PGUP , KC_BTN1 , KC_DOWN , KC_BTN2 , KC_BTN3 , _______ ,
_______ , _______ , KC_1 , KC_2 , KC_3 ,S(KC_MINS), S(KC_8) , S(KC_9) , KC_PGDN , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , KC_0 , KC_DOT , _______ , _______ , _______ , KC_DEL , _______ , _______ , _______ , _______ , _______ , _______
),
Expand Down
6 changes: 3 additions & 3 deletions qmk_firmware/keyboards/keyball/keyball61/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),

[2] = LAYOUT_universal(
_______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
_______ , _______ , KC_7 , KC_8 , KC_9 , _______ , _______ , KC_LEFT , KC_UP , KC_RGHT , _______ , KC_F12 ,
_______ , _______ , KC_4 , KC_5 , KC_6 ,S(KC_SCLN), KC_PGUP , KC_BTN1 , KC_DOWN , KC_BTN2 , KC_BTN3 , _______ ,
SSNP_FRE , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
SSNP_VRT , _______ , KC_7 , KC_8 , KC_9 , _______ , _______ , KC_LEFT , KC_UP , KC_RGHT , _______ , KC_F12 ,
SSNP_HOR , _______ , KC_4 , KC_5 , KC_6 ,S(KC_SCLN), KC_PGUP , KC_BTN1 , KC_DOWN , KC_BTN2 , KC_BTN3 , _______ ,
_______ , _______ , KC_1 , KC_2 , KC_3 ,S(KC_MINS), S(KC_8) , S(KC_9) , KC_PGDN , _______ , _______ , _______ , _______ , _______ ,
_______ , _______ , KC_0 , KC_DOT , _______ , _______ , _______ , KC_DEL , _______ , _______ , _______ , _______ , _______ , _______
),
Expand Down
43 changes: 37 additions & 6 deletions qmk_firmware/keyboards/keyball/lib/keyball/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Keyball Core Function Library

## Scroll snap mode

When scrolling with the trackball, the scroll direction is restricted.
This restriction is called "scroll snap".

The direction of restriction can be changed using special key codes.
You can also release this restriction.
It is called as "scroll snap mode"
The current mode is displayed on the OLED.

There are 3 modes for scroll snap.

1. Vertical (default): key code is `SSNP_VRT`, indicated as `VT`.
2. Horizontal: key code is `SSNP_HOR`, indicated as `HO`.
3. Free: key code is `SSNP_FRE`, indicated as `SCR`.

The scroll snap mode at startup is vertical,
but you can change it by saving the current mode with `KBC_SAVE`

## MEMO

This section contains notes regarding the specifications of this library.
Expand All @@ -9,12 +28,24 @@ If you would like to read it in English, please request a translation via issue
Of course you can translate it for us. If you translate it,
please make pull requests to share it us.

## Scroll Snap Spec
### Scroll Snap Spec

デフォルトで有効になっているスクロールスナップ機能は、
ボールによるスクロールを垂直方向に制限(スナップ)している。
この機能は config.h に `#define KEYBALL_SCROLLSNAP_ENABLE 0` を書き加えることで無効化できる。

トラックボールによるスクロールの方向を制限するのがスクロールスナップ。
現在のスクロールスナップには3つのモードがある。

* 垂直方向にスナップ (デフォルト)
* 水平方向にスナップ
* スナップしない自由スクロール

以上を `SSNP_VRT`, `SSNP_HOR`, `SSNP_FRE` の独自キーコードを用いて手動で切り替える。

#### up to 1.3.2

初期状態でトラックボールによるスクロールを垂直方向に制限(スナップ)している。
この振る舞いは config.h に `#define KEYBALL_SCROLLSNAP_ENABLE 1` を書き加えることで有効化できる。

この機能はスナップモードとフリーモードから構成される。
初期状態はスナップモードで、このモードではスクロール方向は垂直に制限される。
スナップモードで水平の一定方向に一定カウント(デフォルトは12)以上スクロールするとフリーモードに遷移する。
Expand All @@ -32,7 +63,7 @@ please make pull requests to share it us.
#define KEYBALL_SCROLLSNAP_RESET_TIMER 200
```

### History of Scroll Snap
#### History of Scroll Snap

もともとは自由にスクロールできるようにしていた。
しかし思ったよりもボールの感度が高く一定方向だけに動かすのが難しく、
Expand All @@ -53,7 +84,7 @@ please make pull requests to share it us.
先の読み捨てにより、垂直方向のスクロールがワンテンポ遅れ、体験を大幅に損なうことが明らかになった。
この解決のためモード: 初期は垂直のみ、後に自由スクロールする、を導入した。

## Scroll Divider / スクロール除数
### Scroll Divider / スクロール除数

Keyballのセンサーは感度がとても高い。
そのため生の値をスクロール量としてしまうとスクロール操作がとても難しくなった。
Expand All @@ -73,7 +104,7 @@ $n$ の初期値は 4 で 1/8 になることを意味する。
この値は config.h で `KEYBALL_SCROLL_DIV_DEFAULT` マクロを定義することで変更できる。
これを0にすることは考慮していないので設定しないこと。

## Scroll Inhivitor
### Scroll Inhivitor

トラックボールの移動量をポインタに適用するかスクロールに適用するか、
Keyballは内部にスクロールモードという名のモードで管理している。
Expand Down
Loading