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 answers
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
- [Actionscript]How to display the information inside an array of objects
- How to set a colour variable in JS
- When using INSERT OR REPLACE INTO in SQL is there any way to tell if a record was inserted as new or replaced in SQL for AS3?
- How to inject a bean in a view with Crux
- AS3 - Unable to resize Image width and height
- How do I move Pac-Man smoothly in AS3?
- Export Release Build is not working in Adobe Flash Builder, It does nothing on Finish button
- 1009 Error for a Character Skin Symbol in AS3
- Issue setting domain memory
- Implicit coercion of a value with static type Object to a possibly unrelated type Number
- Defer implementation of interface functions to child class
- Simple top 3 scores from an array to textfield
- Need ActionScript 3 coding for input boxes that will determine amount of color fill in a movieclip
- AS3 Caling MC on Parent Timeline from Child
- 2 error problems for simple music players
Related Questions in FLASH
- Failing write/read on RH850 with NOR flash
- Unique ID to transfer guest account data from Adobe AIR to Unity
- flashplayer_32_sa: SecurityError: Error #2028: Local-with-filesystem SWF file
- what is the simplest way and what applications to use in making an exe file that runs .swf file assetss
- Does a physical filesystem works only for a specific type of storage media?
- when I try to enable flash encryption in esp32, the bootloader size is large . But I'm unable to find bootloader field in partition table
- Manage FIFO implemented in a non-volatile flash NOR memory
- create a quiz with actionscript 3
- How to connect two x16 nor flash to nor flash controller?
- Looping in Adobe Flash Professional CS6
- AOSP flahed to android emulator
- How do I compile Flash app files with mxml and as extensions?
- Winbond W25Q01 (1G-BIT) Flash erases 256-bytes not 4K and fails write-read-verify after address 0x07000000
- On Pixel 7a Android AOSP
- Defer implementation of interface functions to child class
Related Questions in KEYBOARD
- On iOS, the keyboard does not offer a 6-character SMS code
- Using javaFx, how to distinguish between return-key and enter-key on the numpad?
- Way to adding emoji to textarea with keyboard, other than copy/paste
- Win32api send message and Pydirectinput and Powertoy (Keyboard Manager ) Not working when open the application
- Keyboard not appearing when connecting smart card reader to iPhones with type-c port. i.e. iPhone 15/ 15 pro
- Xamarin android emulate usb PC Keyboard
- Pygame response to superfast human key presses?
- Why am I getting keyboard letter repeats with Chrome and not Firefox?
- python keyboard libary problem with writhing too many characters
- Wordpress keyboard navigation
- is on keyboard one side alt is more prominent than other side while using them in shortcut keys
- Preserving TextField Input After Keyboard Dismissal in Flutter
- combine KeyCode pressed and modifiers to get final KeyCode
- Shadcn Drawer component with Inputs on mobile, keyboard hides inputs or shows a blank space hiding them
- Create an onscreen swipe keyboard for Mac
Related Questions in KEYBOARD-LAYOUT
- The switch of keyboard layout on Windows: synchronization with the multistage-processing of character input
- Unknown Hp keyboard layout finding difficulty in programming
- Ctrl + ' (single quote) does not send a key sequence on keydown, and VSCode can't toggle line comment
- How to make an MSIX (or standalone executable) for installing a keyboard layout
- Stop user from typing using the onscreen keyboard Python
- c++ keyboards kbd.h need more information about processing the state of the modifier keys
- Developed a Windows keyboard layout DLL but not loaded, no error message
- Microsoft Indic Input 3 is not working with Win UI 3 (Windows App SDK) application Textbox
- Xcode keyboard layout and shortcuts
- Windows Server 2022 Core: how to change default keyboard layout for all users (also login screen)
- How to make a figure of a keyboard where each key has its own color
- How to change the keyboard input in vscode in chromebook?
- How to debug without the F buttons?
- How to switch input language in Qt application?
- How to deal with keyboard layout broken when working in VSCode?
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?
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)
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.