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

keyboard key up

Type:enum
KEY_DOWN

keyboard key down

Type:enum
KEY_LEFT

keyboard key left

Type:enum
KEY_RIGHT

keyboard key right

Type:enum
KEY_PLUS

keyboard key +

Type:enum
KEY_MINUS

keyboard key -

Type:enum
CTRL_LEFT

keyboard key ctrl+let

Type:enum
CTRL_RIGHT

keyboard key ctrl+right

Type:enum
ESC

keyboard key esc

Type:enum
COMBINATIONS

list of keyboard keys and combinations defined

Type:list
__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 with the accepted monitored keys

Type:object
projector_client

object with the methods of projector client class

Type:object
projection_element

object with the methods of projection element class

Type:object
__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