diff --git a/web/src/features/skillcheck/indicator.tsx b/web/src/features/skillcheck/indicator.tsx index 2dc14c9..f961faa 100644 --- a/web/src/features/skillcheck/indicator.tsx +++ b/web/src/features/skillcheck/indicator.tsx @@ -21,10 +21,21 @@ const Indicator: React.FC = ({ angle, offset, multiplier, handleComplete, }), 1 ); - const keyHandler = useCallback( (e: KeyboardEvent) => { - setKeyPressed(e.key.toLowerCase()); + const capitalHetaCode = 880; + const isNonLatin = e.key.charCodeAt(0) >= capitalHetaCode; + var convKey = e.key.toLowerCase() + if (isNonLatin) { + if (e.code.indexOf('Key') === 0 && e.code.length === 4) { // i.e. 'KeyW' + convKey = e.code.charAt(3); + } + + if (e.code.indexOf('Digit') === 0 && e.code.length === 6) { // i.e. 'Digit7' + convKey = e.code.charAt(5); + } + } + setKeyPressed(convKey.toLowerCase()); }, [skillCheck] );