tetrio / issues

Report issues and discuss improvements / feature requests around TETR.IO
https://tetr.io
392 stars 21 forks source link

Input conflict while pressing both LSHIFT and RSHIFT #996

Closed MstrPikachu closed 1 year ago

MstrPikachu commented 2 years ago

Checklist

OS and Version

Windows 10

Browser and version

Desktop Client and Firefox 103.0.2 (64-bit) (latest version)

Describe the bug/issue

Whenever one of the left shift/right shift keys is pressed down, the opposite shift key being pressed will not register. The issue does not occur of the first shift key is released before the other one is pressed, in other words, they have to be down at the same time.

Example

Suppose LSHIFT is bound to hold piece and RSHIFT is bound to rotate 180. Then attempting to rotate 180 after holding (and not releasing LSHIFT) will fail.

Reproducing

  1. Change your controls such that swap is bound to LSHIFT and rotate is bound to RSHIFT.
  2. Enter any game
  3. Hold LSHIFT and press RSHIFT with LSHIFT still being held down. The piece will not rotate.

Expected behavior

Pressing both shift keys at the same time should register both as inputs, and not only the one that was pressed down first.

Screenshots

No response

Console logs

``` bootstrap.js?hv=3c56372e.scyMEcDnR.zSzlihcnY4:2 Bootstrapping for hardver 3c56372e.scyMEcDnR.zSzlihcnY4 tetr.io/:1 A cookie associated with a cross-site resource at https://secure.xsolla.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032. VM186:4247 webgl backend was already registered. Reusing existing backend factory. t.registerBackend @ VM186:4247 VM186:4247 cpu backend was already registered. Reusing existing backend factory. t.registerBackend @ VM186:4247 VM186:4247 Platform browser has already been set. Overwriting the platform with [object Object]. t.setPlatform @ VM186:4247 VM186:4253 TETR.IO VM186:4253 Please be careful when pasting anything in the console. Attackers may be out to steal your login information. VM186:4253 Using the Desktop Client VM186:4253 Up to date. Local version 6.3.0-production | Commit 3c56372e (8/3/2022, 3:57:02 PM) | Server cycle scyMEcDnR | Build zSzlihcnY4 (8/3/2022, 4:09:50 PM) VM186:4253 PixiJS 6.1.3 - WebGL 2 VM186:4253 - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) tetrio-desktop/8.0.0 Chrome/83.0.4103.122 Electron/9.4.0 Safari/537.36 -CPU: 16-coreMemory: ~8 GBConnection: 9.5 Mbps, 0ms RTT [4g] VM186:4253 Renderer: ANGLE (AMD Radeon Pro 5500M Direct3D11 vs_5_0 ps_5_0) VM186:4253 InitialConnect > Obtaining Ribbon endpoint... VM186:4253 InitialConnect > Obtained Ribbon endpoint /ribbon/inoue and 20 spools. VM186:4253 InitialConnect > Getting a spool... VM186:4253 InitialConnect > Spool > Spooling started The resource https://cdn.xsolla.net/img/favicon.ico was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. The resource https://secure.xsolla.com/favicon.ico was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally. VM186:4253 InitialConnect > Spool > 6ms na-mid-maho [CA] v2 // 0.015625, 0.046875, 0 VM186:4253 InitialConnect > Spool > 38ms na-east-mayuri [US] v2 // 0.046875, 0.046875, 0.046875 VM186:4253 InitialConnect > Spool > 34ms na-east-kurisu [US] v2 // 0.125, 0.046875, 0.015625 VM186:4253 InitialConnect > Spool > Spooled na-mid-maho! VM186:4253 InitialConnect > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:356 Ribbon d64c4577cc369141 opened VM186:4253 AmbientRespool > Starting ambient respool. VM186:4253 AmbientRespool > Obtaining Ribbon endpoint... VM186:4253 AmbientRespool > Obtained Ribbon endpoint /ribbon/inoue and 20 spools. VM186:4253 AmbientRespool > Getting a spool... VM186:4253 AmbientRespool > Spool > Spooling started VM186:4253 AmbientRespool > Spool > 9ms na-mid-maho [CA] v2 // 0.15625, 0.078125, 0.015625 VM186:4253 AmbientRespool > Spool > 32ms na-east-mayuri [US] v2 // 0.03125, 0.03125, 0.03125 VM186:4253 AmbientRespool > Spool > 33ms na-east-kurisu [US] v2 // 0.234375, 0.09375, 0.015625 VM186:4253 AmbientRespool > Spool > Spooled na-mid-maho! VM186:4253 AmbientRespool > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:4253 AmbientRespool > Obtained new token, already on best available spool. VM186:4253 AmbientRespool > Starting ambient respool. VM186:4253 AmbientRespool > Obtaining Ribbon endpoint... VM186:4253 AmbientRespool > Obtained Ribbon endpoint /ribbon/inoue and 20 spools. VM186:4253 AmbientRespool > Getting a spool... VM186:4253 AmbientRespool > Spool > Spooling started VM186:4253 AmbientRespool > Spool > 12ms na-mid-maho [CA] v2 // 0.203125, 0.109375, 0.015625 VM186:4253 AmbientRespool > Spool > 33ms na-east-mayuri [US] v2 // 0.125, 0.0625, 0.03125 VM186:4253 AmbientRespool > Spool > 35ms na-east-kurisu [US] v2 // 0.078125, 0.0625, 0.015625 VM186:4253 AmbientRespool > Spool > Spooled na-mid-maho! VM186:4253 AmbientRespool > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:4253 AmbientRespool > Obtained new token, already on best available spool. VM186:4253 AmbientRespool > Starting ambient respool. VM186:4253 AmbientRespool > Obtaining Ribbon endpoint... VM186:4253 AmbientRespool > Obtained Ribbon endpoint /ribbon/lucia and 20 spools. VM186:4253 AmbientRespool > Getting a spool... VM186:4253 AmbientRespool > Spool > Spooling started VM186:4253 AmbientRespool > Spool > 7ms na-mid-maho [CA] v2 // 0, 0.03125, 0 VM186:4253 AmbientRespool > Spool > 30ms na-east-kurisu [US] v2 // 0.015625, 0.0625, 0.015625 VM186:4253 AmbientRespool > Spool > 32ms na-east-mayuri [US] v2 // 0, 0.046875, 0.03125 VM186:4253 AmbientRespool > Spool > Spooled na-mid-maho! VM186:4253 AmbientRespool > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:4253 AmbientRespool > Obtained new token, already on best available spool. VM186:4253 AmbientRespool > Starting ambient respool. VM186:4253 AmbientRespool > Obtaining Ribbon endpoint... VM186:4253 AmbientRespool > Obtained Ribbon endpoint /ribbon/lucia and 20 spools. VM186:4253 AmbientRespool > Getting a spool... VM186:4253 AmbientRespool > Spool > Spooling started VM186:4253 AmbientRespool > Spool > 6ms na-mid-maho [CA] v2 // 0, 0.046875, 0 VM186:4253 AmbientRespool > Spool > 41ms na-east-mayuri [US] v2 // 0.015625, 0.0625, 0.03125 VM186:4253 AmbientRespool > Spool > 34ms na-east-kurisu [US] v2 // 0.125, 0.078125, 0.03125 VM186:4253 AmbientRespool > Spool > Spooled na-mid-maho! VM186:4253 AmbientRespool > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:4253 AmbientRespool > Obtained new token, already on best available spool. VM186:4253 AmbientRespool > Starting ambient respool. VM186:4253 AmbientRespool > Obtaining Ribbon endpoint... VM186:4253 AmbientRespool > Obtained Ribbon endpoint /ribbon/chihaya and 20 spools. VM186:4253 AmbientRespool > Getting a spool... VM186:4253 AmbientRespool > Spool > Spooling started VM186:4253 AmbientRespool > Spool > 4ms na-mid-maho [CA] v2 // 0.046875, 0.0625, 0.015625 VM186:4253 AmbientRespool > Spool > 33ms na-east-mayuri [US] v2 // 0.0625, 0.0625, 0.03125 VM186:4253 AmbientRespool > Spool > 34ms na-east-kurisu [US] v2 // 0.1875, 0.109375, 0.046875 VM186:4253 AmbientRespool > Spool > Spooled na-mid-maho! VM186:4253 AmbientRespool > Obtained spool na-mid-maho (na-mid-maho.spool.tetr.io) [CA]. VM186:4253 AmbientRespool > Obtained new token, already on best available spool. DevTools failed to load SourceMap: Could not parse content for https://tetr.io/tf.min.js.map: Unexpected token < in JSON at position 0 ```

Additional context

No response

Que-tin commented 2 years ago

For whom ever fixes this in the end: (@o5k)

Instead of using .key or .keyCode on the Input Event, check for .code. Might be a bit bigger bugfix, as the overall keymapping has to be ported to using the .code-values instead. Otherwise there is no way to differentiate between the following Buttons:

As these have the same key as well as keyCode on the older input events.