Terminal Glasses Events

Bartek Bok edited this page Mar 9, 2016 · 2 revisions

All events have same first three arguments: <1:source peripheral> <2:player name> <3:player uuid>

State events:

  • glasses_attach - player started wearing glasses

  • glasses_detach - player stopped wearing glasses

  • glasses_capture - player initiated capture mode (used keyboard)

  • glasses_release - player exited capture mode (exited GUI screen)

Chat events:

  • glasses_chat_command <1:source peripheral> <2:player name> <3:player uuid> <4:command> - player wearing glasses typed chat message starting with $$ (note: this message will not be visible in chat)
  • glasses_chat_message <1:source peripheral> <2:player name> <3:player uuid> <4:message> - player wearing glasses typed any chat message ($$ messages are not included)

Keyboard event (available only in capture mode)

  • glasses_key_down <4:key code> <5:key character> <6:is repeated event>
  • glasses_key_up <4:key code>

Mouse events (when cursor wasn't over any component)

  • glasses_mouse_scroll <4:wheel distance>
  • glasses_mouse_down <4:button>
  • glasses_mouse_up <4:button>
  • glasses_mouse_drag <4:dx> <5:dy> // since OpenPeripheralAddons > 0.4, dx, dy - distance from last drag or mouse down event

Mouse component events (when cursor was over any component)

Note: x and y are in component coordinates, so they include rotation

  • glasses_component_mouse_wheel <4:component id> <5:is private surface> <6:x> <7:y> <8:wheel>
  • glasses_component_mouse_down <4:component id> <5:is private surface> <6:x> <7:y> <8:button>
  • glasses_component_mouse_up <4:component id> <5:is private surface> <6:x> <7:y> <8:button>

Note: x and y are relative to component top left corner

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.