mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 16:06:02 +01: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:
@@ -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