|
|
(5 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| __NOTOC__ | | __NOTOC__ |
− | <languages />
| |
| <!-- GIDEROSOBJ:KeyCode --> | | <!-- GIDEROSOBJ:KeyCode --> |
− | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | + | '''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> |
− | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | + | '''Available since:''' Gideros 2011.6<br/> |
− | '''<translate>Inherits from</translate>:''' [[Special:MyLanguage/Object|Object]]<br/> | + | '''Inherits from:''' [[Object]]<br/> |
| | | |
− | === <translate>Description</translate> === | + | === Description === |
| KeyCode table holds the key code constants. These map directly to a physical key on the keyboard. | | KeyCode table holds the key code constants. These map directly to a physical key on the keyboard. |
| | | |
− | === <translate>Examples</translate> === | + | === Examples === |
− | '''Listening for back button''' | + | '''Listening for back button on phones/tablets''' |
− | <source lang="lua"> | + | <syntaxhighlight lang="lua"> |
| stage:addEventListener(Event.KEY_DOWN, function(event) | | stage:addEventListener(Event.KEY_DOWN, function(event) |
| if event.keyCode == KeyCode.BACK then | | if event.keyCode == KeyCode.BACK then |
Line 17: |
Line 16: |
| end | | end |
| end) | | end) |
− | </source> | + | </syntaxhighlight> |
| + | |
| + | '''Full screen''' |
| + | <syntaxhighlight lang="lua"> |
| + | isfullscreen = false |
| + | |
| + | function setFullScreen(xbool) |
| + | application:setFullScreen(xbool) |
| + | end |
| + | |
| + | function myKeysPressed() |
| + | self:addEventListener(Event.KEY_DOWN, function(e) |
| + | -- modifier |
| + | local modifier = application:getKeyboardModifiers() |
| + | local alt = (modifier & KeyCode.MODIFIER_ALT) > 0 |
| + | -- switch full screen |
| + | if alt and e.keyCode == KeyCode.ENTER then |
| + | isfullscreen = not isfullscreen |
| + | setFullScreen(isfullscreen) |
| + | end |
| + | end) |
| + | end |
| + | </syntaxhighlight> |
| | | |
| {|- | | {|- |
| | style="width: 50%; vertical-align:top;"| | | | style="width: 50%; vertical-align:top;"| |
− | === <translate>Methods</translate> === | + | |
| + | === Methods === |
| | | |
| | style="width: 50%; vertical-align:top;"| | | | style="width: 50%; vertical-align:top;"| |
− | === <translate>Events</translate> === | + | === Events === |
− | === <translate>Constants</translate> === | + | === Constants === |
− | [[Special:MyLanguage/KeyCode.A|KeyCode.A]]<br/><!-- GIDEROSCST:KeyCode.A 65--> | + | '''[[KeyCode Constants]]''' |
− | [[Special:MyLanguage/KeyCode.ALT|KeyCode.ALT]]<br/><!-- GIDEROSCST:KeyCode.ALT 18-->
| + | <!--GIDEROSCST:KeyCode.A 65--> |
− | [[Special:MyLanguage/KeyCode.B|KeyCode.B]]<br/><!-- GIDEROSCST:KeyCode.B 66-->
| + | <!--GIDEROSCST:KeyCode.ALT 18--> |
− | [[Special:MyLanguage/KeyCode.BACK|KeyCode.BACK]]<br/><!-- GIDEROSCST:KeyCode.BACK 301-->
| + | <!--GIDEROSCST:KeyCode.B 66--> |
− | [[Special:MyLanguage/KeyCode.BACKSPACE|KeyCode.BACKSPACE]]<br/><!-- GIDEROSCST:KeyCode.BACKSPACE 8-->
| + | <!--GIDEROSCST:KeyCode.BACK 301--> |
− | [[Special:MyLanguage/KeyCode.C|KeyCode.C]]<br/><!-- GIDEROSCST:KeyCode.C 67-->
| + | <!--GIDEROSCST:KeyCode.BACKSPACE 8--> |
− | [[Special:MyLanguage/KeyCode.CENTER|KeyCode.CENTER]]<br/><!-- GIDEROSCST:KeyCode.CENTER 304-->
| + | <!--GIDEROSCST:KeyCode.C 67--> |
− | [[Special:MyLanguage/KeyCode.CTRL|KeyCode.CTRL]]<br/><!-- GIDEROSCST:KeyCode.CTRL 17-->
| + | <!--GIDEROSCST:KeyCode.CENTER 304--> |
− | [[Special:MyLanguage/KeyCode.D|KeyCode.D]]<br/><!-- GIDEROSCST:KeyCode.D 68-->
| + | <!--GIDEROSCST:KeyCode.CTRL 17--> |
− | [[Special:MyLanguage/KeyCode.DELETE|KeyCode.DELETE]]<br/><!-- GIDEROSCST:KeyCode.DELETE 403-->
| + | <!--GIDEROSCST:KeyCode.D 68--> |
− | [[Special:MyLanguage/KeyCode.DOWN|KeyCode.DOWN]]<br/><!-- GIDEROSCST:KeyCode.DOWN 40-->
| + | <!--GIDEROSCST:KeyCode.DELETE 403--> |
− | [[Special:MyLanguage/KeyCode.E|KeyCode.E]]<br/><!-- GIDEROSCST:KeyCode.E 69-->
| + | <!--GIDEROSCST:KeyCode.DOWN 40--> |
− | [[Special:MyLanguage/KeyCode.END|KeyCode.END]]<br/><!-- GIDEROSCST:KeyCode.END 401-->
| + | <!--GIDEROSCST:KeyCode.E 69--> |
− | [[Special:MyLanguage/KeyCode.ENTER|KeyCode.ENTER]]<br/><!-- GIDEROSCST:KeyCode.ENTER 13-->
| + | <!--GIDEROSCST:KeyCode.END 401--> |
− | [[Special:MyLanguage/KeyCode.ESC|KeyCode.ESC]]<br/><!-- GIDEROSCST:KeyCode.ESC 27-->
| + | <!--GIDEROSCST:KeyCode.ENTER 13--> |
− | [[Special:MyLanguage/KeyCode.F|KeyCode.F]]<br/><!-- GIDEROSCST:KeyCode.F 70-->
| + | <!--GIDEROSCST:KeyCode.ESC 27--> |
− | [[Special:MyLanguage/KeyCode.G|KeyCode.G]]<br/><!-- GIDEROSCST:KeyCode.G 71-->
| + | <!--GIDEROSCST:KeyCode.F 70--> |
− | [[Special:MyLanguage/KeyCode.H|KeyCode.H]]<br/><!-- GIDEROSCST:KeyCode.H 72-->
| + | <!--GIDEROSCST:KeyCode.G 71--> |
− | [[Special:MyLanguage/KeyCode.HOME|KeyCode.HOME]]<br/><!-- GIDEROSCST:KeyCode.HOME 400-->
| + | <!--GIDEROSCST:KeyCode.H 72--> |
− | [[Special:MyLanguage/KeyCode.I|KeyCode.I]]<br/><!-- GIDEROSCST:KeyCode.I 73-->
| + | <!--GIDEROSCST:KeyCode.HOME 400--> |
− | [[Special:MyLanguage/KeyCode.INSERT|KeyCode.INSERT]]<br/><!-- GIDEROSCST:KeyCode.INSERT 402-->
| + | <!--GIDEROSCST:KeyCode.I 73--> |
− | [[Special:MyLanguage/KeyCode.J|KeyCode.J]]<br/><!-- GIDEROSCST:KeyCode.J 74-->
| + | <!--GIDEROSCST:KeyCode.INSERT 402--> |
− | [[Special:MyLanguage/KeyCode.K|KeyCode.K]]<br/><!-- GIDEROSCST:KeyCode.K 75-->
| + | <!--GIDEROSCST:KeyCode.J 74--> |
− | [[Special:MyLanguage/KeyCode.L|KeyCode.L]]<br/><!-- GIDEROSCST:KeyCode.L 76-->
| + | <!--GIDEROSCST:KeyCode.K 75--> |
− | [[Special:MyLanguage/KeyCode.L1|KeyCode.L1]]<br/><!-- GIDEROSCST:KeyCode.L1 307-->
| + | <!--GIDEROSCST:KeyCode.L 76--> |
− | [[Special:MyLanguage/KeyCode.LEFT|KeyCode.LEFT]]<br/><!-- GIDEROSCST:KeyCode.LEFT 37-->
| + | <!--GIDEROSCST:KeyCode.L1 307--> |
− | [[Special:MyLanguage/KeyCode.M|KeyCode.M]]<br/><!-- GIDEROSCST:KeyCode.M 77-->
| + | <!--GIDEROSCST:KeyCode.LEFT 37--> |
− | [[Special:MyLanguage/KeyCode.MENU|KeyCode.MENU]]<br/><!-- GIDEROSCST:KeyCode.MENU 303-->
| + | <!--GIDEROSCST:KeyCode.M 77--> |
− | [[Special:MyLanguage/KeyCode.MODIFIER_ALT|KeyCode.MODIFIER_ALT]]<br/><!-- GIDEROSCST:KeyCode.MODIFIER_ALT 2-->
| + | <!--GIDEROSCST:KeyCode.MENU 303--> |
− | [[Special:MyLanguage/KeyCode.MODIFIER_CTRL|KeyCode.MODIFIER_CTRL]]<br/><!-- GIDEROSCST:KeyCode.MODIFIER_CTRL 4-->
| + | <!--GIDEROSCST:KeyCode.MODIFIER_ALT 2--> |
− | [[Special:MyLanguage/KeyCode.MODIFIER_META|KeyCode.MODIFIER_META]]<br/><!-- GIDEROSCST:KeyCode.MODIFIER_META 8-->
| + | <!--GIDEROSCST:KeyCode.MODIFIER_CTRL 4--> |
− | [[Special:MyLanguage/KeyCode.MODIFIER_NONE|KeyCode.MODIFIER_NONE]]<br/><!-- GIDEROSCST:KeyCode.MODIFIER_NONE 0-->
| + | <!--GIDEROSCST:KeyCode.MODIFIER_META 8--> |
− | [[Special:MyLanguage/KeyCode.MODIFIER_SHIFT|KeyCode.MODIFIER_SHIFT]]<br/><!-- GIDEROSCST:KeyCode.MODIFIER_SHIFT 1-->
| + | <!--GIDEROSCST:KeyCode.MODIFIER_NONE 0--> |
− | [[Special:MyLanguage/KeyCode.MOUSE_LEFT|KeyCode.MOUSE_LEFT]]<br/><!-- GIDEROSCST:KeyCode.MOUSE_LEFT 1-->
| + | <!--GIDEROSCST:KeyCode.MODIFIER_SHIFT 1--> |
− | [[Special:MyLanguage/KeyCode.MOUSE_MIDDLE|KeyCode.MOUSE_MIDDLE]]<br/><!-- GIDEROSCST:KeyCode.MOUSE_MIDDLE 4-->
| + | <!--GIDEROSCST:KeyCode.MOUSE_LEFT 1--> |
− | [[Special:MyLanguage/KeyCode.MOUSE_NONE|KeyCode.MOUSE_NONE]]<br/><!-- GIDEROSCST:KeyCode.MOUSE_NONE 0-->
| + | <!--GIDEROSCST:KeyCode.MOUSE_MIDDLE 4--> |
− | [[Special:MyLanguage/KeyCode.MOUSE_RIGHT|KeyCode.MOUSE_RIGHT]]<br/><!-- GIDEROSCST:KeyCode.MOUSE_RIGHT 2-->
| + | <!--GIDEROSCST:KeyCode.MOUSE_NONE 0--> |
− | [[Special:MyLanguage/KeyCode.N|KeyCode.N]]<br/><!-- GIDEROSCST:KeyCode.N 78-->
| + | <!--GIDEROSCST:KeyCode.MOUSE_RIGHT 2--> |
− | [[Special:MyLanguage/KeyCode.NUM_0|KeyCode.NUM_0]]<br/><!-- GIDEROSCST:KeyCode.NUM_0 48-->
| + | <!--GIDEROSCST:KeyCode.N 78--> |
− | [[Special:MyLanguage/KeyCode.NUM_1|KeyCode.NUM_1]]<br/><!-- GIDEROSCST:KeyCode.NUM_1 49-->
| + | <!--GIDEROSCST:KeyCode.NUM_0 48--> |
− | [[Special:MyLanguage/KeyCode.NUM_2|KeyCode.NUM_2]]<br/><!-- GIDEROSCST:KeyCode.NUM_2 50-->
| + | <!--GIDEROSCST:KeyCode.NUM_1 49--> |
− | [[Special:MyLanguage/KeyCode.NUM_3|KeyCode.NUM_3]]<br/><!-- GIDEROSCST:KeyCode.NUM_3 51-->
| + | <!--GIDEROSCST:KeyCode.NUM_2 50--> |
− | [[Special:MyLanguage/KeyCode.NUM_4|KeyCode.NUM_4]]<br/><!-- GIDEROSCST:KeyCode.NUM_4 52-->
| + | <!--GIDEROSCST:KeyCode.NUM_3 51--> |
− | [[Special:MyLanguage/KeyCode.NUM_5|KeyCode.NUM_5]]<br/><!-- GIDEROSCST:KeyCode.NUM_5 53-->
| + | <!--GIDEROSCST:KeyCode.NUM_4 52--> |
− | [[Special:MyLanguage/KeyCode.NUM_6|KeyCode.NUM_6]]<br/><!-- GIDEROSCST:KeyCode.NUM_6 54-->
| + | <!--GIDEROSCST:KeyCode.NUM_5 53--> |
− | [[Special:MyLanguage/KeyCode.NUM_7|KeyCode.NUM_7]]<br/><!-- GIDEROSCST:KeyCode.NUM_7 55-->
| + | <!--GIDEROSCST:KeyCode.NUM_6 54--> |
− | [[Special:MyLanguage/KeyCode.NUM_8|KeyCode.NUM_8]]<br/><!-- GIDEROSCST:KeyCode.NUM_8 56-->
| + | <!--GIDEROSCST:KeyCode.NUM_7 55--> |
− | [[Special:MyLanguage/KeyCode.NUM_9|KeyCode.NUM_9]]<br/><!-- GIDEROSCST:KeyCode.NUM_9 57-->
| + | <!--GIDEROSCST:KeyCode.NUM_8 56--> |
− | [[Special:MyLanguage/KeyCode.O|KeyCode.O]]<br/><!-- GIDEROSCST:KeyCode.O 79-->
| + | <!--GIDEROSCST:KeyCode.NUM_9 57--> |
− | [[Special:MyLanguage/KeyCode.P|KeyCode.P]]<br/><!-- GIDEROSCST:KeyCode.P 80-->
| + | <!--GIDEROSCST:KeyCode.O 79--> |
− | [[Special:MyLanguage/KeyCode.PAGEDOWN|KeyCode.PAGEDOWN]]<br/><!-- GIDEROSCST:KeyCode.PAGEDOWN 405-->
| + | <!--GIDEROSCST:KeyCode.P 80--> |
− | [[Special:MyLanguage/KeyCode.PAGEUP|KeyCode.PAGEUP]]<br/><!-- GIDEROSCST:KeyCode.PAGEUP 404-->
| + | <!--GIDEROSCST:KeyCode.PAGEDOWN 405--> |
− | [[Special:MyLanguage/KeyCode.Q|KeyCode.Q]]<br/><!-- GIDEROSCST:KeyCode.Q 81-->
| + | <!--GIDEROSCST:KeyCode.PAGEUP 404--> |
− | [[Special:MyLanguage/KeyCode.R|KeyCode.R]]<br/><!-- GIDEROSCST:KeyCode.R 82-->
| + | <!--GIDEROSCST:KeyCode.Q 81--> |
− | [[Special:MyLanguage/KeyCode.R1|KeyCode.R1]]<br/><!-- GIDEROSCST:KeyCode.R1 308-->
| + | <!--GIDEROSCST:KeyCode.R 82--> |
− | [[Special:MyLanguage/KeyCode.RIGHT|KeyCode.RIGHT]]<br/><!-- GIDEROSCST:KeyCode.RIGHT 39-->
| + | <!--GIDEROSCST:KeyCode.R1 308--> |
− | [[Special:MyLanguage/KeyCode.S|KeyCode.S]]<br/><!-- GIDEROSCST:KeyCode.S 83-->
| + | <!--GIDEROSCST:KeyCode.RIGHT 39--> |
− | [[Special:MyLanguage/KeyCode.SEARCH|KeyCode.SEARCH]]<br/><!-- GIDEROSCST:KeyCode.SEARCH 302-->
| + | <!--GIDEROSCST:KeyCode.S 83--> |
− | [[Special:MyLanguage/KeyCode.SELECT|KeyCode.SELECT]]<br/><!-- GIDEROSCST:KeyCode.SELECT 305-->
| + | <!--GIDEROSCST:KeyCode.SEARCH 302--> |
− | [[Special:MyLanguage/KeyCode.SHIFT|KeyCode.SHIFT]]<br/><!-- GIDEROSCST:KeyCode.SHIFT 16-->
| + | <!--GIDEROSCST:KeyCode.SELECT 305--> |
− | [[Special:MyLanguage/KeyCode.SPACE|KeyCode.SPACE]]<br/><!-- GIDEROSCST:KeyCode.SPACE 32-->
| + | <!--GIDEROSCST:KeyCode.SHIFT 16--> |
− | [[Special:MyLanguage/KeyCode.START|KeyCode.START]]<br/><!-- GIDEROSCST:KeyCode.START 306-->
| + | <!--GIDEROSCST:KeyCode.SPACE 32--> |
− | [[Special:MyLanguage/KeyCode.T|KeyCode.T]]<br/><!-- GIDEROSCST:KeyCode.T 84-->
| + | <!--GIDEROSCST:KeyCode.START 306--> |
− | [[Special:MyLanguage/KeyCode.TAB|KeyCode.TAB]]<br/><!-- GIDEROSCST:KeyCode.TAB 9-->
| + | <!--GIDEROSCST:KeyCode.T 84--> |
− | [[Special:MyLanguage/KeyCode.U|KeyCode.U]]<br/><!-- GIDEROSCST:KeyCode.U 85-->
| + | <!--GIDEROSCST:KeyCode.TAB 9--> |
− | [[Special:MyLanguage/KeyCode.UP|KeyCode.UP]]<br/><!-- GIDEROSCST:KeyCode.UP 38-->
| + | <!--GIDEROSCST:KeyCode.U 85--> |
− | [[Special:MyLanguage/KeyCode.V|KeyCode.V]]<br/><!-- GIDEROSCST:KeyCode.V 86-->
| + | <!--GIDEROSCST:KeyCode.UP 38--> |
− | [[Special:MyLanguage/KeyCode.W|KeyCode.W]]<br/><!-- GIDEROSCST:KeyCode.W 87-->
| + | <!--GIDEROSCST:KeyCode.V 86--> |
− | [[Special:MyLanguage/KeyCode.X|KeyCode.X]]<br/><!-- GIDEROSCST:KeyCode.X 88-->
| + | <!--GIDEROSCST:KeyCode.W 87--> |
− | [[Special:MyLanguage/KeyCode.Y|KeyCode.Y]]<br/><!-- GIDEROSCST:KeyCode.Y 89-->
| + | <!--GIDEROSCST:KeyCode.X 88--> |
− | [[Special:MyLanguage/KeyCode.Z|KeyCode.Z]]<br/><!-- GIDEROSCST:KeyCode.Z 90-->
| + | <!--GIDEROSCST:KeyCode.Y 89--> |
− | [[Special:MyLanguage/KeyCode.F1|KeyCode.F1]]<br/><!-- GIDEROSCST:KeyCode.F1 501-->
| + | <!--GIDEROSCST:KeyCode.Z 90--> |
− | [[Special:MyLanguage/KeyCode.F2|KeyCode.F2]]<br/><!-- GIDEROSCST:KeyCode.F2 502-->
| + | <!--GIDEROSCST:KeyCode.F1 501--> |
− | [[Special:MyLanguage/KeyCode.F3|KeyCode.F3]]<br/><!-- GIDEROSCST:KeyCode.F3 503-->
| + | <!--GIDEROSCST:KeyCode.F2 502--> |
− | [[Special:MyLanguage/KeyCode.F4|KeyCode.F4]]<br/><!-- GIDEROSCST:KeyCode.F4 504-->
| + | <!--GIDEROSCST:KeyCode.F3 503--> |
− | [[Special:MyLanguage/KeyCode.F5|KeyCode.F5]]<br/><!-- GIDEROSCST:KeyCode.F5 505-->
| + | <!--GIDEROSCST:KeyCode.F4 504--> |
− | [[Special:MyLanguage/KeyCode.F6|KeyCode.F6]]<br/><!-- GIDEROSCST:KeyCode.F6 506-->
| + | <!--GIDEROSCST:KeyCode.F5 505--> |
− | [[Special:MyLanguage/KeyCode.F7|KeyCode.F7]]<br/><!-- GIDEROSCST:KeyCode.F7 507-->
| + | <!--GIDEROSCST:KeyCode.F6 506--> |
− | [[Special:MyLanguage/KeyCode.F8|KeyCode.F8]]<br/><!-- GIDEROSCST:KeyCode.F8 508-->
| + | <!--GIDEROSCST:KeyCode.F7 507--> |
− | [[Special:MyLanguage/KeyCode.F9|KeyCode.F9]]<br/><!-- GIDEROSCST:KeyCode.F9 509-->
| + | <!--GIDEROSCST:KeyCode.F8 508--> |
− | [[Special:MyLanguage/KeyCode.F10|KeyCode.F10]]<br/><!-- GIDEROSCST:KeyCode.F10 510-->
| + | <!--GIDEROSCST:KeyCode.F9 509--> |
− | [[Special:MyLanguage/KeyCode.F11|KeyCode.F11]]<br/><!-- GIDEROSCST:KeyCode.F11 511-->
| + | <!--GIDEROSCST:KeyCode.F10 510--> |
− | [[Special:MyLanguage/KeyCode.F12|KeyCode.F12]]<br/><!-- GIDEROSCST:KeyCode.F12 512-->
| + | <!--GIDEROSCST:KeyCode.F11 511--> |
| + | <!--GIDEROSCST:KeyCode.F12 512--> |
| |} | | |} |
| | | |
| {{GIDEROS IMPORTANT LINKS}} | | {{GIDEROS IMPORTANT LINKS}} |