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
-
KEY_DOWN
keyboard key down
-
KEY_LEFT
keyboard key left
-
KEY_RIGHT
keyboard key right
-
KEY_PLUS
keyboard key +
-
KEY_MINUS
keyboard key -
-
CTRL_LEFT
keyboard key ctrl+let
-
CTRL_RIGHT
keyboard key ctrl+right
-
ESC
keyboard key esc
-
COMBINATIONS
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 with the accepted monitored keys
-
projector_client
object with the methods of projector client class
-
projection_element
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
|