Skip to content

Peripherals

helgeerbe edited this page Jan 20, 2022 · 1 revision

Touch, mouse and keyboard control

  • Touch the left half of the screen (a): previous picture
  • Touch the right half of the screen (d): next picture
  • Touch near the top of the screen: open menu

Menu items are configurable, the existing options include:

  • Pause ( ): pause/resume the playback
  • Display off (o): turn off the display (when off, any input from the selected peripheral device will turn it back on)
  • Location on/off (l): shows or hides location information
  • Exit (e): exit PictureFrame
  • Power down (p): power down the device

Menu items offer customization via config. The label of each button can be modified (e.g., localized to a different language) as well as its keyboard shortcut. The business logic of each menu item is universal for all input types. More menu items can be created by subclassing IPMenuItem and defining its callback method.

As not to interfere with clock that is also near the top of the screen, when the menu is shown, then clock is hidden.

In the touch mode, if not interacting with the menu for a specific amount of time (defined in config), it automatically disappears. Auto-hiding can be disabled (config). Menu can be manually hidden by touching the screen anywhere outside of the menu, too.

In the mouse mode, the menu remains shown for as long as the mouse pointer hovers it.

In the keyboard mode, the menu is not rendered.

Only one mode can be selected at a time - it is not possible to simultaneously enable keyboard and mouse, for example. The reason is technical. In the keyboard mode, in order for menu items to register keyboard strokes, the menu must be constantly shown. In order not to block the view, is is positioned out of view. This behavior is incompatible with mouse and touch.

As the older interface_kbd has been effectively replaced by interface_peripherals, it has been removed.

There is one change that affects the global playback behavior. Previously, when the playback was paused, it was not possible to navigate to previous or next picture. With this PR, manual navigation to previous or next picture is possible even when the playback is paused.

Known issues:

  • The picframe does not run as a service with keyboard input enabled (both touch and mouse do).
  • I encountered wrong touch-to-position mapping on my hardware - RPi3B+, Waveshare 10.1inch HDMI LCD (E). The screen has a resolution of 1024x600 px. While the pointer follows very precisely touch in the desktop, and pi3d correctly detects the screen resolution (both Display.width and Display.height), it seems as if pi3d internally tried to translate the touch to coordinates assuming 4:3 screen ratio (that would be 1024x768). If I compensate for this inaccuracy on the y axis, the touch is detected precisely. I would like to ask for your feedback from different touchscreens and resolutions to see if this logic applies universally or not.