mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-30 21:24:44 +00:00
fix(web/skillcheck): fix not being able to hit skill check with capslock
apparently the return key for event can differentiate lower and uppercase keys
This commit is contained in:
1 parent
ce5697f3b2
commit
59051d505b
1 file changed
+2
-2
@@ -5,7 +5,7 @@ export const useKeyPress = (targetKey: KeyboardEvent['key']) => {
|
|||||||
|
|
||||||
const downHandler = React.useCallback(
|
const downHandler = React.useCallback(
|
||||||
({ key }: KeyboardEvent) => {
|
({ key }: KeyboardEvent) => {
|
||||||
if (key === targetKey) {
|
if (key.toLowerCase() === targetKey) {
|
||||||
setKeyPressed(true);
|
setKeyPressed(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -14,7 +14,7 @@ export const useKeyPress = (targetKey: KeyboardEvent['key']) => {
|
|||||||
|
|
||||||
const upHandler = React.useCallback(
|
const upHandler = React.useCallback(
|
||||||
({ key }: KeyboardEvent) => {
|
({ key }: KeyboardEvent) => {
|
||||||
if (key === targetKey) {
|
if (key.toLowerCase() === targetKey) {
|
||||||
setKeyPressed(false);
|
setKeyPressed(false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user