Simple Case
The key a is pressed and released: 3 events fired by GLUTIN LIB
- Glutin::Event::KeyboardInput{element_state='Pressed', virtual_key_code: 'A')
- Glutin::Event::ReceivedCharacter{'a'}
- Glutin::Event::KeyboardInput{element_state='Released', virtual_key_code: 'A')
Complex Case
The keys Ctrl and a are pressed and released at the same time: 5 events fired by GLUTIN LIB
- Glutin::Event::KeyboardInput{element_state='Pressed', virtual_key_code: 'LCONTROL'}
- Glutin::Event::KeyboardInput{element_state='Pressed', virtual_key_code: '\u{1}'}
- Glutin::Event::ReceivedCharacter{'\u{1}'}
- Glutin::Event::KeyboardInput{element_state='Released', virtual_key_code: '\u{1}'}
- Glutin::Event::KeyboardInput{element_state='Released', virtual_key_code: 'LCONTROL'}
For the complex case, the character received is the ASCII Code of the combination: http://academic.evergreen.edu/projects/biophysics/technotes/program/ascii_ctrl.htm
Diagram for Simple Case
###############################################################################################################################
#
# GLUTIN LIB
#
###############################################################################################################################
|| || ||
|| || ||
|| || ||
1. Glutin::Event::KeyboardInput 2. Glutin::Event::ReceivedCharacter 3. Glutin::Event::KeyboardInput
|| || ||
|| || ||
|| || ||
\/ \/ \/
#############################################################################################################################
# handle_window_event()
----------------------------------------------------------------------------------------------------------------------------- #
# GLUTIN PORT
#
-----------------------------------------------------------------------------------------------------------------------------
# handle_keyboard_input() # received_character() # handle_keyboard_input() # handle_key()
#############################################################################################################################
|| || || /\
|| || || ||
|| || || ||
1. WindowEvent::KeyEvent 2. WindowEvent::KeyEvent 3. WindowEvent::KeyEvent 4. Call to fn
(KeyState::Pressed) (KeyState::Pressed) (KeyState::Released) ||
|| || || ||
|| || || ||
|| || || ||
\/ \/ \/ ||
###############################################################################################################################
# handle_events()
-----------------------------------------------------------------------------------------------------------------------------
#
# COMPOSITOR
#
################################################################################################################################
...
...Not shown here: Events are then sent to the Constellation, then script thread, then it comes back the other way...
...