mirror of
https://github.com/He4eT/tabswiper.git
synced 2026-05-04 16:47:23 +00:00
keyboard handlers: layout agnostic keycodes
This commit is contained in:
parent
4c2cbcc67e
commit
8d344c865e
1 changed files with 5 additions and 5 deletions
|
|
@ -1,19 +1,19 @@
|
||||||
export const attachKeyboardHandlers = (store) => {
|
export const attachKeyboardHandlers = (store) => {
|
||||||
document.addEventListener('keydown', (e) => {
|
document.addEventListener('keydown', (e) => {
|
||||||
switch (e.key) {
|
switch (e.code) {
|
||||||
case 'd':
|
case 'KeyD':
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
store.actions.closeTab(store.getCurrentState().currentTab)
|
store.actions.closeTab(store.getCurrentState().currentTab)
|
||||||
return
|
return
|
||||||
case 'k':
|
case 'KeyK':
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
store.actions.keepTab(store.getCurrentState().currentTab)
|
store.actions.keepTab(store.getCurrentState().currentTab)
|
||||||
return
|
return
|
||||||
case 'f':
|
case 'KeyF':
|
||||||
case 'ArrowUp':
|
case 'ArrowUp':
|
||||||
store.actions.goToTab(store.getCurrentState().currentTab)
|
store.actions.goToTab(store.getCurrentState().currentTab)
|
||||||
return
|
return
|
||||||
case 'r':
|
case 'KeyR':
|
||||||
location.reload()
|
location.reload()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue