Input.Joystick.setKey() This page was last modified over 30 day(s) ago and has 0 comment(s)


Back to Input.Joystick Class Summary

Availability
Windows

Usage
mdm.Input.Joystick.setKey(joystickButtonID:Number, keyboardKeyCode:String):Void

Parameters
joystickButtonID:Number - Joystick button identifier

keyboardKeyCode:String - Keyboard key code

Returns
Nothing

Description
Assigns a Joystick button to a keyboard key. Valid codes for keyboardKeyCode are:

TAB = 9
RETURN = 13
SHIFT = 10
CONTROL = 17
ESCAPE = 27
SPACE = 20
HOME = 36
LEFT = 37
UP = 38
RIGHT = 39
DOWN = 40
{ 0 thru 9 are the same as ASCII '0' thru '9' (48 - 57) }
{ A thru Z are the same as ASCII 'A' thru 'Z' (65 - 90) }
NUMPAD0 = 96
NUMPAD1 = 97
NUMPAD2 = 98
NUMPAD3 = 99
NUMPAD4 = 100
NUMPAD5 = 101
NUMPAD6 = 102
NUMPAD7 = 103
NUMPAD8 = 104
NUMPAD9 = 105
F1 = 112
F2 = 113
F3 = 114
F4 = 115
F5 = 116
F6 = 117
F7 = 118
F8 = 119
F9 = 120
F10 = 121
F11 = 122
F12 = 123
LSHIFT = 160
RSHIFT = 161
LCONTROL = 162
RCONTROL = 163

Notes
To assign a left mouse click to a Joystick button, use the 'keyboardKeyCode' "9999".

Example Code
//Assigns fire button 1 on Joystick 1 to the equivalent of pressing the space bar:
mdm.Input.Joystick.setKey(1, "$20");


mdm.Input.Joystick Class Example Downloads
No Example Downloads Available


Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page