47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
var ct_wasd_up = OS.C.Add("WASD Up", OS.Keycode.w);
|
|
var ct_wasd_left = OS.C.Add("WASD Left", OS.Keycode.a);
|
|
var ct_wasd_down = OS.C.Add("WASD Down", OS.Keycode.s);
|
|
var ct_wasd_right = OS.C.Add("WASD Right", OS.Keycode.d);
|
|
var ct_arrow_up = OS.C.Add("Arrow Up", OS.Keycode.up);
|
|
var ct_arrow_left = OS.C.Add("Arrow Left", OS.Keycode.left);
|
|
var ct_arrow_down = OS.C.Add("Arrow Down", OS.Keycode.down);
|
|
var ct_arrow_right = OS.C.Add("Arrow Right", OS.Keycode.right);
|
|
|
|
var ct_shift = OS.C.Add("Shift", OS.Keycode.shift);
|
|
var ct_space = OS.C.Add("Confirm", OS.Keycode.space);
|
|
var ct_esc = OS.C.Add("Cancel", OS.Keycode.escape);
|
|
|
|
function loadControls () {}
|
|
|
|
function ct_up () {
|
|
return {
|
|
held : ct_wasd_up.held || ct_arrow_up.held,
|
|
down : ct_wasd_up.down || ct_arrow_up.down,
|
|
up : ct_wasd_up.up || ct_arrow_up.up
|
|
}
|
|
}
|
|
|
|
function ct_left () {
|
|
return {
|
|
held : ct_wasd_left.held || ct_arrow_left.held,
|
|
down : ct_wasd_left.down || ct_arrow_left.down,
|
|
up : ct_wasd_left.up || ct_arrow_left.up
|
|
}
|
|
}
|
|
|
|
function ct_down () {
|
|
return {
|
|
held : ct_wasd_down.held || ct_arrow_down.held,
|
|
down : ct_wasd_down.down || ct_arrow_down.down,
|
|
up : ct_wasd_down.up || ct_arrow_down.up
|
|
}
|
|
}
|
|
|
|
function ct_right () {
|
|
return {
|
|
held : ct_wasd_right.held || ct_arrow_right.held,
|
|
down : ct_wasd_right.down || ct_arrow_right.down,
|
|
up : ct_wasd_right.up || ct_arrow_right.up
|
|
}
|
|
}
|