KeyBind

From Crumbled World Wiki
Revision as of 14:23, 5 July 2025 by Anders (talk | contribs) (Created page with "{{:KeyBindExampleCode}} ==Constructor== {| class="wikitable" !|function !|description |- |KeyBind() | |- |KeyBind(string groupName, string subGroupName, string keyName) | |- |} ==Functions== {| class="wikitable" !|return !|function !|description |- |int |getNumKeyBinds() |Get number of different keybinds. |- |string |getKeyBindName(int id) |Retun the text of the key bind. example "Left Ctrl + A" |- |string...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

KeyBindExampleCode

Constructor

function description
KeyBind()
KeyBind(string groupName, string subGroupName, string keyName)

Functions

return function description
int getNumKeyBinds() Get number of different keybinds.
string getKeyBindName(int id) Retun the text of the key bind. example "Left Ctrl + A"
string getGroupName() Return group name.
string getSubGroupName() Return sub group name.
string getName() Return name.
bool getPressed() Returns true if any of the keybinds is preesed.
bool getPressed(bool ignoreControlKeys) Returns true if any of the keybinds is preesed.
bool getHeld() Returns true if any of the keybinds is held.
bool getHeld(bool ignoreControlKeys) Returns true if any of the keybinds is held.
bool bindKey(int id) Rebind a keybind. return true if a new key combination has been enterd.
string setKeyBind(string keyBind) Set key bind from text given by getKeyBindName().
setKeyBindKeyboard(int id, Key key) id key bind id [0,1]
setKeyBindKeyboard(int id, Key controlKey1, Key key)
setKeyBindKeyboard(int id, Key controlKey1, Key controlKey2, Key key)
setKeyBindKeyboard(int id, Key controlKey1, Key controlKey2, Key controlKey3, Key key)
setKeyBindMouse(int id, MouseKey key)
setKeyBindMouse(int id, Key controlKey1, MouseKey key)
setKeyBindMouse(int id, Key controlKey1, Key controlKey2, MouseKey key)
setKeyBindMouse(int id, Key controlKey1, Key controlKey2, Key controlKey3, MouseKey key)
clearAllKeyBinds()
clearKeyBind(int id)
save()