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) => {
|
||||
document.addEventListener('keydown', (e) => {
|
||||
switch (e.key) {
|
||||
case 'd':
|
||||
switch (e.code) {
|
||||
case 'KeyD':
|
||||
case 'ArrowLeft':
|
||||
store.actions.closeTab(store.getCurrentState().currentTab)
|
||||
return
|
||||
case 'k':
|
||||
case 'KeyK':
|
||||
case 'ArrowRight':
|
||||
store.actions.keepTab(store.getCurrentState().currentTab)
|
||||
return
|
||||
case 'f':
|
||||
case 'KeyF':
|
||||
case 'ArrowUp':
|
||||
store.actions.goToTab(store.getCurrentState().currentTab)
|
||||
return
|
||||
case 'r':
|
||||
case 'KeyR':
|
||||
location.reload()
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue