mirror of
https://github.com/He4eT/elseifplayer.git
synced 2026-05-04 17:07:22 +00:00
InputBox: ignore keyboard shortcuts
This commit is contained in:
parent
674c6c7c51
commit
22cc737f8e
1 changed files with 13 additions and 0 deletions
|
|
@ -35,6 +35,17 @@ const keyNames = {
|
|||
}
|
||||
/* eslint-enable */
|
||||
|
||||
const hasModifier = (event) => {
|
||||
const modifiers = [
|
||||
event.altKey,
|
||||
event.ctrlKey,
|
||||
event.metaKey,
|
||||
event.shiftKey,
|
||||
]
|
||||
|
||||
return modifiers.some((modifier) => modifier === true)
|
||||
}
|
||||
|
||||
export default function InputBox ({
|
||||
inputType,
|
||||
windows,
|
||||
|
|
@ -75,6 +86,8 @@ export default function InputBox ({
|
|||
: charHandlerDefault)(event)
|
||||
|
||||
const charHandlerDefault = (event) => {
|
||||
if (hasModifier(event)) { return undefined }
|
||||
|
||||
event.preventDefault()
|
||||
|
||||
const key =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue