Please allow keyboard mapping so that all mobile key can be use when testing on PC local player.
As I test with Gideros v2012.2.2, only the up, down, left, right keys can generate event, there's no way I can create 'Menu', 'Back', 'Search', 'Center' keycode.
Here is the code that I used to test:
-- ------------------------------------------------------------
local keyNames = {
[KeyCode.BACK] = "back",
[KeyCode.SEARCH] = "search",
[KeyCode.MENU] = "menu",
[KeyCode.CENTER] = "center",
[KeyCode.LEFT] = "left",
[KeyCode.UP] = "up",
[KeyCode.RIGHT] = "right",
[KeyCode.DOWN] = "down",
}
-- ------------------------------------------------------------
local function onKeyDown(event)
print("key down: "..keyNames[event.keyCode])
end
local function onKeyUp(event)
print("key up: "..keyNames[event.keyCode])
end
-- ------------------------------------------------------------
-- MAIN
-- ------------------------------------------------------------
stage:setOrientation(Stage.LANDSCAPE_LEFT)
stage:addEventListener(Event.KEY_DOWN, onKeyDown)
stage:addEventListener(Event.KEY_UP, onKeyUp)
Comments
There is some discussion here about this issue: http://www.giderosmobile.com/forum/discussion/737#Item_20
Likes: keszegh