bitovi / bitovi/syn

keyCode is not mapped correctly when capital character is given

Open
#195 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
441
Forks
254
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/2228672/196061867-7b6443ad-f207-484e-8694-cf81abfb9cd6.png)

v0.15.0 / latest

Firefox native behaviour:

![image](https://user-images.githubusercontent.com/2228672/196061886-ae50b4b5-5dd3-43b7-b1c0-effc9158f351.png)

`key` is capitalized according to the active shift, thus such capitalized/UC character must be supported by syn.js

test case:

```
['keypress', 'keydown', 'keyup'].forEach((k) => $('#xxx')[0].addEventListener(k, event => { console.log(event); }));
syn.trigger($('#xxx')[0], 'keyup', {character: 'n'});
syn.trigger($('#xxx')[0], 'keyup', {character: 'N', shiftKey: true});
```

must log both events with non-zero `keyCode`

Contributor guide

Open the contributing guide

Research direction

Start with the issue's syn.trigger test case and inspect the synthetic keyboard-event path that maps character and shiftKey to keyCode. Reproduce both the lowercase and uppercase calls in Firefox or the project test setup; done means each logged keyup event has a non-zero keyCode.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.