No description
Find a file
2022-10-02 21:09:00 +02:00
lv_drivers@33983bcb0a Add in-code support for rotating the UI 2021-11-22 20:09:54 +01:00
lvgl@a2b555e096 Add in-code support for rotating the UI 2021-11-22 20:09:54 +01:00
squeek2lvgl@041602ac94 Update squeek2lvgl & improve docs about generating layouts 2022-10-02 21:09:00 +02:00
.gitignore Switch to Meson 2021-09-23 14:42:48 +02:00
.gitmodules Add squeek2lvgl as submodule and simple conversion script 2021-09-13 13:35:26 +02:00
buffyboard.h Move version and font to separate header 2021-11-23 20:11:25 +01:00
command_line.c Move version and font to separate header 2021-11-23 20:11:25 +01:00
command_line.h Add CLI options for rotation and version 2021-11-23 20:04:23 +01:00
COPYING Initial import 2021-09-13 13:30:15 +02:00
cursor.c Initial import 2021-09-13 13:30:15 +02:00
cursor.h Initial import 2021-09-13 13:30:15 +02:00
find-lvgl-sources.sh Make find-lvgl-sources.sh work in (a)sh 2021-11-18 21:13:55 +01:00
font_32.c Switch to OpenSans and add further layers 2021-10-12 21:00:27 +02:00
FontAwesome5-Solid+Brands+Regular.woff Add fonts and customise shift key 2021-09-20 12:59:32 +02:00
indev.c Remove unused MAX_KEYBOARD_DEVS 2021-11-20 21:23:38 +01:00
indev.h Eliminate libinput_multi.* 2021-10-25 19:41:11 +02:00
lv_conf.h Add copyright headers 2021-09-21 14:48:29 +02:00
lv_drv_conf.h Add copyright headers 2021-09-21 14:48:29 +02:00
main.c Move version and font to separate header 2021-11-23 20:11:25 +01:00
meson.build Update version to 0.2.0 2021-11-23 20:35:32 +01:00
Montserrat-Regular.ttf Add fonts and customise shift key 2021-09-20 12:59:32 +02:00
OpenSans-Regular.ttf Switch to OpenSans and add further layers 2021-10-12 21:00:27 +02:00
README.md Update squeek2lvgl & improve docs about generating layouts 2022-10-02 21:09:00 +02:00
regenerate-layouts.sh Add fonts and customise shift key 2021-09-20 12:59:32 +02:00
sq2lv_layouts.c Allow key-repeat 2021-10-24 20:25:40 +02:00
sq2lv_layouts.h Allow key-repeat 2021-10-24 20:25:40 +02:00
terminal.c Add missing blank line 2021-09-24 09:39:59 +02:00
terminal.h Automatically resize active terminal to not overlap with keyboard 2021-09-17 14:36:25 +02:00
uinput_device.c Use macros for setting input event time 2021-11-21 19:27:20 +01:00
uinput_device.h Switch to Meson 2021-09-23 14:42:48 +02:00

Buffyboard

Touch-enabled framebuffer keyboard (not only) for vampire slayers.

[[TOC]]

About

Buffyboard is a touch-enabled on-screen keyboard running on the Linux framebuffer. It's primarily intended for vampire hunting1 but you can also use it as a general purpose keyboard.

Buffyboard uses LVGL for input processing and rendering. Key events are forwarded directly to the kernel via a uinput device. Since the latter emulates a hardware keyboard, the terminal keymap must match with buffyboard's layout or else on-screen keys might not produce the correct result.

Status

We are en route to v1 which aims at providing a useable, visually pleasant application including fbkeyboard's most essential features. For details about the current status, see the v1 milestone. You may also browse the full list of open issues to get an idea of what's planned beyond v1.

Here are a few highlights of what already works:

  • On-screen keyboard control via mouse, trackpad or touchscreen
  • Multi-layer keyboard layout including lowercase letters, uppercase letters, numbers and selected symbols (based on top three layers of squeekboard's US terminal layout)
  • Key chords with one or more modifiers terminated by a single non-modifier (e.g. CTRL-c)
  • Highlighting of active modifiers
  • Automatic resizing (and later reset) of active VT to prevent overlap with keyboard

For a growing collection of demo videos, see the wiki.

Upstreaming

Over the course of implementing buffyboard, suitable fixes and features have been upstreamed to the lvgl and lv_drivers repositories. The benefit of this goes both ways. Downstream we can rely on the features being maintained in the future and upstream they can make the features available to the larger audience of LVGL users.

Below is a summary of contributions upstreamed thus far.

lvgl

lv_drivers

Development

Dependencies

  • lvgl (git submodule / linked statically)
  • lv_drivers (git submodule / linked statically)
  • squeek2lvgl (git submodule / linked statically)
  • libinput
  • evdev kernel module
  • uinput kernel module

Building & running

Some of buffyboard's dependencies are included as git submodules in this repository. You can clone the repository and initialise the submodules with

$ git clone https://gitlab.com/cherrypicker/buffyboard.git
$ cd buffyboard
$ git submodule init
$ git submodule update

When pulling changes from the remote later, either use git pull --recurse-submodules or manually run git submodule update as needed after pulling.

Once you have the sources, you can build the app and run it in a VT. Unless your user account has special privileges, sudo will be needed to access input device files.

$ meson _build
$ meson compile -C _build
$ sudo chvt 2
$ sudo ./_build/buffyboard

With meson <0.55 use ninja instead of meson compile.

Fonts

In order to work with LVGL, fonts need to be converted to bitmaps, stored as C arrays. Buffyboard currently uses a combination of the OpenSans font for text and the FontAwesome font for pictograms. For both fonts only limited character ranges are included to reduce the binary size. To (re)generate the C file containing the combined font, run the following command

$ npx lv_font_conv --bpp 4 --size 32 --no-compress -o font_32.c --format lvgl \
    --font OpenSans-Regular.ttf \
      --range '0x0020-0x007F' \
      --range '0x00A0-0x00FF' \
      --range '0x0100-0x017F' \
      --range '0x0370-0x03FF' \
      --range '0x2000-0x206F' \
      --range '0x20A0-0x20CF' \
      --range '0x2200-0x22FF' \
    --font FontAwesome5-Solid+Brands+Regular.woff \
      --range '0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2' \
      --range '0xF35B'

Below is a short explanation of the different unicode ranges used above.

  • OpenSans
    • Basic Latin (0x0020-0x007F)
    • Latin-1 supplement (0x00A0-0x00FF)
    • Latin extended A (0x0100-0x017F)
    • Greek and Coptic (0x0370-0x03FF)
    • General punctuation (0x2000-0x206F)
    • Currency symbols (0x20A0-0x20CF)
    • Mathematical operators (0x2200-0x22FF)
  • FontAwesome
    • Standard LV_SYMBOL_* glyphs (0xF001,0xF008,0xF00B,0xF00C,0xF00D,0xF011,0xF013,0xF015,0xF019,0xF01C,0xF021,0xF026,0xF027,0xF028,0xF03E,0xF0E0,0xF304,0xF043,0xF048,0xF04B,0xF04C,0xF04D,0xF051,0xF052,0xF053,0xF054,0xF067,0xF068,0xF06E,0xF070,0xF071,0xF074,0xF077,0xF078,0xF079,0xF07B,0xF093,0xF095,0xF0C4,0xF0C5,0xF0C7,0xF0C9,0xF0E7,0xF0EA,0xF0F3,0xF11C,0xF124,0xF158,0xF1EB,0xF240,0xF241,0xF242,0xF243,0xF244,0xF287,0xF293,0xF2ED,0xF55A,0xF7C2,0xF8A2)
    • arrow-alt-circle-up (0xF35B)

Keyboard layouts

Buffyboard uses squeekboard layouts converted to C via squeek2lvgl. To regenerate the layouts, ensure that you have pipenv installed (e.g. via pip install --user pipenv) and then run

$ ./regenerate-layouts.sh

from the root of the repository.

Acknowledgements

The lv_port_linux_frame_buffer project served as a starting point for the codebase.

The mouse cursor image was taken from lv_sim_emscripten.

Buffyboard was inspired by fbkeyboard.

License

Buffyboard is licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The OpenSans font is licensed under the Apache License 2.0.

The FontAwesome font is licensed under the Open Font License version 1.1.

Footnotes


  1. If you still don't know what vampires have to do with all of this, the train of thought is: Linux framebuffer 👉 buffyboard 👉 ... wait for it ... 👉 Buffy the Vampire Slayer. There you have it. I never claimed I was funny. 😅 ↩︎