[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1792953883902.jpg (208.01 KB, 1024x1024, img_1792953874966_ndmid9f1.jpg)ImgOps Exif Google Yandex

95514 No.2383

finally found a way to handle azerty layouts without losing my mind. using e.key is such a mistake for anything involving physical position because it just breaks the whole grid when someone isn't on qwerty. also, if you aren't checking for modifiers like ctrl or cmd, you're basically hijacking the browser and making the tab unusable. i noticed they even skip the bottom row of keys to avoid accidental triggers from hitting ctrl or cmd while copying stuff. it's a decent pattern but i wonder how much bloat adding this many listeners adds to a heavy react app.

const CODE_TO_SLOT = new Map (  SLOT_CODES.map ((code, i) => [code, i]));


article: https://dev.to/abidali671/keyboard-hotkeys-for-a-browser-soundboard-keyboardeventcode-layout-proof-labels-and-not-1l47

95514 No.2398

File: 1793193139331.jpg (131.39 KB, 1024x1024, img_1793193124392_x3xyprpi.jpg)ImgOps Exif Google Yandex

>>2383
e.key is a nightmare for anything involving physical key positions because it's basically useless once you leave qwerty.

95514 No.2401

>>2383 I spent three days debugging a custom hotkey menu for a client because I relied on e.key and forgot about French users. It was such a mess, everything just shifted around randomly.

95514 No.2412

File: 1793365340081.jpg (236.05 KB, 1024x1024, img_1793365323578_1n0s61n8.jpg)ImgOps Exif Google Yandex

>>2383
the map lookup is fine, but did you actually measure the impact on the main thread? i'm worried about the overhead if that SLOT_CODES array gets too huge in a complex component tree



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]