Skip to content

Instantly share code, notes, and snippets.

@Kaiochao
Last active July 12, 2016 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kaiochao/d6219a8c847a4b535994b9ef64232ab5 to your computer and use it in GitHub Desktop.
Save Kaiochao/d6219a8c847a4b535994b9ef64232ab5 to your computer and use it in GitHub Desktop.

Keyboard

by Kaiochao

Library URL: http://www.byond.com/developer/Kaiochao/Keyboard

Additions

In the Object tab of Dream Maker, enable "Show all nodes" at the bottom. Compile or Update if you haven't already. Double-click any of the nodes to go to their (latest) definition. If it's from this library, don't use it unless it has a description.

Compiler Flags
  • KEYBOARD_NO_REPEAT: Disables all Repeat-related functions.
Datums
  • keyboard
Enums
  • KeyAxis
  • Keys
Interfaces
  • keylistener: Contains all the procs that are called on client.keylistener.
Client variables
  • keyboard/keyboard: A reference to the keyboard being used by the client, for use in external procs.
  • keylistener/keylistener: An object that keyboard events are forwarded to.
Client procs (Keyboard events)
  • OnKeyDown
  • OnKeyUp
  • OnKeyRepeat
  • OnKeyboardRepeat

Changes

July 11 2016

  • Added support for BYOND 511's "Any" key binding. Only works in 511!
    511 isn't out yet, so it's currently untested.

  • Added Keys enum for safe access to key names.
    Should be everything on the keyboard, but let me know if I missed anything.

  • Added KeyAxis enum for the possible return values of keyboard.GetAxis().
    GetAxis() is still compatible with the inequality operators.

  • Added client.OnKeyX() procs and client.keylistener.
    These are called by keyboard.OnKeyX().
    They call client.keylistener.OnKeyX().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment