I'm developing a game in AS3 and would like to set the game to bind movement to WASD if the player's keyboard is QWERTY, WARS if it's Colemak, etc. Is this possible, and if so, what are some ways that I could implement this?
Detecting keyboard layout (QWERTY, Colemak, etc.) in ActionScript 3
953 Views Asked by Jonathan Jin At
2
There are 2 best solutions below
0
Focusless
On
This is a pretty hacky solution I just thought of by reading this so i don't really know if it works that well... But you could create an invisible TextField that you set focus on with stage.focus so that whatever the user types gets in there. Then you can have a keyboardEvent Listener for released buttons that takes the value from the TextField and resets the textfields text.
Related Questions in ACTIONSCRIPT-3
- How to create an ActionScript 3.0 in Flash to display Current Date, Time and Day of Week
- textinput.needsSoftKeyboard does not work (air for android)
- AS3 Get currentFrame of current MovieClip
- call Win32 API in flex to set Window Display Affinity
- Air Native Extensions: Released Air App w/Windows Native Extension works fine on develpment PC but not on other computers
- TestFlight API and stats with as3
- Error while using removeChild() and accessing members of array
- Flash erase image with mask - gotoandplay next frame
- Adding a listener to a VerticalScrollBar in flex
- AS3 array to clean up long code?
- AS3 - How can objects that appear randomly never touch each other?
- import a sound externally or from the library? AS3
- Nesting Asynchronous Promises in ActionScript
- AS3 - How can multiple objects that appear randomly NEVER touch each other?
- ActionScript + Ruby
Related Questions in FLASH
- How to create an ActionScript 3.0 in Flash to display Current Date, Time and Day of Week
- textinput.needsSoftKeyboard does not work (air for android)
- Flash erase image with mask - gotoandplay next frame
- Flash CS3: Text appears on button mouse over or text mouse over
- import a sound externally or from the library? AS3
- How to use Database in Flash App?
- undefined method loadCompressedDataFromByteArray through a reference with static type flash.media:Sound
- Cam streaming Flash client/widget
- Pairing a draggable object to a target object in AS3
- update flashVars of flowplayer to change video via swfObject
- Adobe Flash Pro: Locate asset with missing font
- Making an HTML Jigsaw Puzzle in Flash CC
- Passing data between MXML files and opening one after Click on another
- Moving things inside a two-dimensional array in as3?
- AS3 + webcam. Dispatch event on presence
Related Questions in KEYBOARD
- Layout not shifting up when keyboard is open
- Unity3d - Input.GetKey returns true more than once
- Android: how to prevent jumping/flashing of views when trying to replace keyboard with a view
- Objective c keyboard opens unwillingly
- How to add scrollview to keyboardView in android
- C# - SendInput() - Hold Key Down?
- How to change keyboard language programmatically in windows 8
- Dismiss the Keyboard in Swift via hitTest
- How to convert VK scan codes to appropriate character for language selected
- How to get keystrokes with java outside of frames
- del key on a PC keyboard with MAC mini
- How to find which key is pressed, not which character it will be?
- Android soft keyboard in Chinese languages
- Is this Possible to add Keyboard Predictive option in UISearchBar keyboard
- Xcode Changing Keyboard
Related Questions in KEYBOARD-LAYOUT
- How do I find the physical position of a CGKeyCode?
- How to write a keyboard layout dll using the KbdLayerDescriptor symbol?
- Visual Studio 2013 changes the keyboard language
- Changed Keyboard layout and now can't login anymore because letters are missing on Linux
- Is there a way to change the keyboard layout in Vim on Windows?
- Special characters in Eclipse on an non-US keyboard
- Android keyboard layout language
- autohotkey does not exist in current keyboard layout - solution examples
- Detecting keyboard layout (QWERTY, Colemak, etc.) in ActionScript 3
- Electron builder fails with: no 'object' file generated
- How to translate a string from a keyboard layout to another?
- detect keyboard layout with javascript
- How to map a X11 KeySym to a Unicode character?
- Ctrl + ' (single quote) does not send a key sequence on keydown, and VSCode can't toggle line comment
- How do I display a keyboard on-screen?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It's not possible to detect keyboard layout in AS3.
What you could do is check the
flash.system.Capabilities.languageproperty and based on the language code pre-select the likely keyboard layout. It's obviously not reliable, so you need to let the user be able to change setting.For instance, French language most likely means the user is in a French speaking region of the world. But while France/Belgium/Luxembourg typically uses AZERTY, Swiss French most likely means a QWERTZ layout (Source: http://en.wikipedia.org/wiki/QWERTZ).
Therefore, a slightly better approach is to detect the country instead of the language setting. But country detection cannot be done with pure AS3, you need a call a server-side script (which in turn uses IP address lookup to determine country).
Not sure it's worth all this hassle, I would simply default to QWERTY since it's the most common.