How can I in JavaScript detect the typing of a question mark on AZERTY keyboard ? On QWERTY keyboard a question mark produces the code 191, but on AZERTY it seems to produce code 188 (comma on QWERTY). Or should I distinguish between both keyboards in JavaScript, but how ?
Keycode detection on AZERTY vs. QWERTY
2.4k Views Asked by AudioBubble At
2
There are 2 best solutions below
0
AudioBubble
On
If you want to detect the character being typed, use KeyboardEvent.key, not KeyboardEvent.code -- the key property will contain either the character that was typed (like "?"), or a string like "Shift" or "ArrowUp" for special keys. The location of the key on the keyboard won't affect the result.
$("#f").on("keydown", function(ev) {
$(this).val(ev.key);
return false;
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="f" autocomplete="off">
Related Questions in JAVASCRIPT
- Angular Show All When No Filter Is Supplied
- Why does a function show up as not defined
- I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
- Set "More" "Less" font size
- Using pagination on a table in AngularJS
- How to sort these using Javascript or Jquery Most effectively
- how to fill out the table with next values in array with one button
- State with different subviews
- Ajax jQuery firing multiple time display event for the same result
- Getting and passing MVC Model data to AngularJS controller
- Disable variable in eval
- javascript nested loops waiting for user input
- .hover() seems to overwrite .click()
- How to sort a multi-dimensional array by the second array in descending order?
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
Related Questions in KEYCODE
- What is the char represented by keycode (15) c#?
- Is Shift the only key that can change the value of keyCode?
- On click, press enter to textbox
- How to print key character code in OSX?
- Backslash key code is recognized as german umlaut
- Convert char into KeyEvent on Android
- Convert character in PHP to javascript event keycode
- c# ascii to keycode?
- c# textBox1.Text converting to KeyCode and send it to a chat program with SendMessage
- Closing modal with e.keypress
- List of hex keyboard scan codes and USB HID keyboard documentation
- Problems with barcode reading using PreFilterMessage
- How to combine key codes to work together in javascript
- Delphi Key Code 17 in FormKeyDown
- How can I format my character code to a string name
Related Questions in QWERTY
- Consecutive letters in python
- How to detect if Android device has QWERTY keypad
- Dvorak Programmers-Qwerty ⌘
- KeyCodes for azerty keyboard in JAVA
- Somehow my Java animation isn't moving
- Calculating Levenshtein Distance permitting QWERTY errors in R
- How can you detect an AZERTY / QWERTY keyboard in C++ on windows?
- SystemTap semantic error when trying to run dvorak-qwerty script
- An Ideal Keyboard Layout for Programming
- Android physical keyboard Hungarian QWERTY layout missing
- can I rearrange the keys on a das keyboard from QWERTY to Dvorak?
- Intercepting the Nokia Ctrl/Chr key press in Java
- Mac Style "Dvorak - Qwerty Command" keyboard mapping for Windows?
- Keyboard didn't appear, FBConnect on iphone
- Need number only soft keyboard?
Related Questions in AZERTY-KEYBOARD
- Detecting certain keys on an AZERTY keyboard?
- What are the pygame key names for number keys on an azerty keyboard?
- How to perform C-M-\ on an azerty keyboard? (and other azerty tips)
- JavaFX Accelerator using Numeric keys (Ctrl+1) not cross plateform?
- Export DISPLAY with azerty keyboard
- Android studio shortcut for French keyboard
- Cannot close curly brackets on Android Studio with a AZERTY keyboard
- Mapping a "Num Lock" key on a French laptop keyboard
- Wrong Azerty keyboard layout for Logitech MX keys Azerty version in Linux
- Alt button not detected on some keymap shortcut IntelliJ (elementaryOS 5.1.7
- Convert QWERTY barcode scanner input to AZERTY
- Google Script Autocomplete activates when semicolon is pressed instead of period
- Atom editor with Azerty Keyboard : which keys to fold/unfold lines?
- Vim and azerty keyboards
- AZERTY keycode with GLFW3
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?
The fastest solution I can think of is to compare the key with the actual question mark, so something like this would be a good solution.