Skip to content

Commit

Permalink
indicate scroll snap mode in OLED
Browse files Browse the repository at this point in the history
"SCR" in OLED will be changed to "SCH", or "SCV", when scroll snap mode
is enabled.
  • Loading branch information
koron committed Apr 15, 2024
1 parent 9fd0fb0 commit 753f0e3
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 7 deletions.
2 changes: 1 addition & 1 deletion qmk_firmware/keyboards/keyball/keyball39/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/logofont/logofont.c"
# define OLED_FONT_START 32
# define OLED_FONT_END 195
# define OLED_FONT_END 197
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
Expand Down
2 changes: 1 addition & 1 deletion qmk_firmware/keyboards/keyball/keyball44/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/logofont/logofont.c"
# define OLED_FONT_START 32
# define OLED_FONT_END 195
# define OLED_FONT_END 197
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
Expand Down
2 changes: 1 addition & 1 deletion qmk_firmware/keyboards/keyball/keyball46/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/logofont/logofont.c"
# define OLED_FONT_START 32
# define OLED_FONT_END 195
# define OLED_FONT_END 197
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
Expand Down
2 changes: 1 addition & 1 deletion qmk_firmware/keyboards/keyball/keyball61/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/logofont/logofont.c"
# define OLED_FONT_START 32
# define OLED_FONT_END 195
# define OLED_FONT_END 197
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
Expand Down
16 changes: 16 additions & 0 deletions qmk_firmware/keyboards/keyball/lib/keyball/keyball.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,23 @@ void keyball_oled_render_ballinfo(void) {
oled_write_P(PSTR("00 "), false);

// indicate scroll mode: on/off
// and scroll snap mode: "SCR", "SCV", "SCH"
#if KEYBALL_SCROLLSNAP_ENABLE == 2
oled_write_char('\xBE', false);
switch (keyball.scrollsnap_mode) {
case KEYBALL_SCROLLSNAP_MODE_VERTICAL:
oled_write_char('\xC4', false);
break;
case KEYBALL_SCROLLSNAP_MODE_HORIZONTAL:
oled_write_char('\xC5', false);
break;
case KEYBALL_SCROLLSNAP_MODE_FREE:
oled_write_char('\xBF', false);
break;
}
#else
oled_write_P(PSTR("\xBE\xBF"), false);
#endif
if (keyball.scroll_mode) {
oled_write_P(LFSTR_ON, false);
} else {
Expand Down
26 changes: 26 additions & 0 deletions qmk_firmware/keyboards/keyball/lib/logofont/font.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,32 @@
00000000
```

### "CV" in 1 char, combined with a leading of "SCR"

To indicate scroll snap mode is vertical.

```
00100001
00000000
00001111
00110000
00001111
00000000
```

### "CH" in 1 char, combined with a leading of "SCR"

To indicate scroll snap mode is horizontal.

```
00100001
00000000
00111111
00000100
00111111
00000000
```

## "DIV" in 2 chars

```
Expand Down
5 changes: 3 additions & 2 deletions qmk_firmware/keyboards/keyball/lib/logofont/logofont.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ const unsigned char font[] PROGMEM = {
// 0xC0
0x3F, 0x21, 0x1E, 0x00, 0x21, 0x3F, // C0, C1:
0x21, 0x00, 0x0F, 0x30, 0x0F, 0x00, // "DIV" in 2 chars indicate "divider"
0x3E, 0x09, 0x3E, 0x00, 0x3F, 0x06, // C2, D3:
0x3E, 0x09, 0x3E, 0x00, 0x3F, 0x06, // C2, C3:
0x3F, 0x00, 0x3F, 0x20, 0x20, 0x00, // "AML" in 2 chars

0x21, 0x00, 0x0F, 0x30, 0x0F, 0x00, // C4: A trail half of "SCV".
0x21, 0x00, 0x3F, 0x04, 0x3F, 0x00, // C5: A trail half of "SCH".
};
// clang-format on
2 changes: 1 addition & 1 deletion qmk_firmware/keyboards/keyball/one47/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef OLED_FONT_H
# define OLED_FONT_H "keyboards/keyball/lib/logofont/logofont.c"
# define OLED_FONT_START 32
# define OLED_FONT_END 195
# define OLED_FONT_END 197
#endif

#if !defined(LAYER_STATE_8BIT) && !defined(LAYER_STATE_16BIT) && !defined(LAYER_STATE_32BIT)
Expand Down

0 comments on commit 753f0e3

Please sign in to comment.