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
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in KEYCODE
- working on serial/references number input filed - validations-keycodes
- combine KeyCode pressed and modifiers to get final KeyCode
- why do I have to press escape on the keyboard twice in vb.net
- Peculiarities of grabbing keys and scancodes different methods LINUX
- How to use keycodes in an array to filter which keys are taken as input within a 'keyup' event listener?
- How to get key presses / combinations without being modified into alt combinations?
- Ubuntu GDK C++ how to get the code of a key using CAPSLOCK
- key code 10182 for Exit button in tizen studio?
- I need to give condition between english keyboard layout and japanese keyboard layout using jquery
- The part keeps rotating even when l press space bar
- why am i getting null value eve if i press 'asdfghjkl'?
- Convert KeyEvent DPad
- KeyDown event doesnt trigger with Shift. Other Keys Work
- Problem with Window.event.keyCode and .dat memory read VBS hta
- Ubuntu, C++, xkb/symbols files: Is there a mapping between keynames and keycode?
Related Questions in QWERTY
- Android physical keyboard Hungarian QWERTY layout missing
- Detect "Windows" key of qwerty keyboard in Android
- SystemTap semantic error when trying to run dvorak-qwerty script
- Is there a windows keyboard layout that would both be QWERTY and allow for french accents without disturbing code
- Can python detect which key is used on keyboard regardless of keyboard layout?
- Low level codes for sending keys regardless of keyboard format? (QWERTY, AZERTY, etc) Python
- Consecutive letters in python
- Keycode detection on AZERTY vs. QWERTY
- Calculating Levenshtein Distance permitting QWERTY errors in R
- Why QWERTY keyboard built this way?
- French keyboard locked in QWERTY
- IntelliJ/PhpStorm only switches keyboard layout by half
- Is it possible to get a keypressed position instead of its keyCode or char?
- How can you detect an AZERTY / QWERTY keyboard in C++ on windows?
- Can't configure VIM for Dvorak keymap
Related Questions in AZERTY-KEYBOARD
- JavaFX Accelerator using Numeric keys (Ctrl+1) not cross plateform?
- Export DISPLAY with azerty 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
- What are the pygame key names for number keys on an azerty keyboard?
- Google Script Autocomplete activates when semicolon is pressed instead of period
- Mapping a "Num Lock" key on a French laptop keyboard
- Cannot close curly brackets on Android Studio with a AZERTY keyboard
- Android studio shortcut for French keyboard
- Atom editor with Azerty Keyboard : which keys to fold/unfold lines?
- Qwerty to azerty PhpStorm
- Keycode detection on AZERTY vs. QWERTY
- Convert QWERTY barcode scanner input to AZERTY
- Vim and azerty keyboards
- Change virtual keyboard to AZERTY
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.