zlp_keyboard module

This module contains utility classes and methods which wrap the keyboard listener for monitoring.

class z_laser_zlp1.zlp_keyboard.KeyboardParameters[source]

Bases: object

This class contains the accepted monitored keys.

KEY_UP

enum – keyboard key up

KEY_DOWN

enum – keyboard key down

KEY_LEFT

enum – keyboard key left

KEY_RIGHT

enum – keyboard key right

KEY_PLUS

enum – keyboard key +

KEY_MINUS

enum – keyboard key -

CTRL_LEFT

enum – keyboard key ctrl+let

CTRL_RIGHT

enum – keyboard key ctrl+right

ESC

enum – keyboard key esc

COMBINATIONS

list – list of keyboard keys and combinations defined

__init__()[source]

Initialize the KeyboardParameters object.

class z_laser_zlp1.zlp_keyboard.KeyboardControl(projector_client, projection_element)[source]

Bases: object

This class is used to monitor the keyboard presses in order to change properties of a projection element in real time.

Parameters:
  • projector_client (object) – object with the methods of projector client class
  • projection_element (object) – object with the methods of projection element class
keyboard_params

object – object with the accepted monitored keys

projector_client

object – object with the methods of projector client class

projection_element

object – object with the methods of projection element class

__init__(projector_client, projection_element)[source]

Initialize the KeyboardControl object.

on_press(key, cs_name, proj_elem_params)[source]

Check if the key pressed if one of the list and execute the respective tasks.

Parameters:
  • key (enum) – key pressed
  • cs_name (str) – name of the coordinate system
  • proj_elem_params (object) – object with the parameters of the projection element to monitor
on_release(key)[source]

Remove current stored key, on release.

Parameters:key (enum) – key pressed
init_keyboard_listener(cs_name, figure_params)[source]

Start keyboard listener for monitoring key presses.

Parameters:
  • cs_name (str) – name of the coordinate system
  • figure_params (object) – object with the parameters of the projection element to monitor