keybindings.ts (hoppscotch-2.2.1) | : | keybindings.ts (hoppscotch-3.0.0) | ||
---|---|---|---|---|
import { onBeforeUnmount, onMounted } from "@nuxtjs/composition-api" | import { onBeforeUnmount, onMounted } from "vue" | |||
import { HoppAction, invokeAction } from "./actions" | import { HoppAction, invokeAction } from "./actions" | |||
import { isAppleDevice } from "./platformutils" | import { isAppleDevice } from "./platformutils" | |||
import { isDOMElement, isTypableElement } from "./utils/dom" | import { isDOMElement, isTypableElement } from "./utils/dom" | |||
/** | /** | |||
* This variable keeps track whether keybindings are being accepted | * This variable keeps track whether keybindings are being accepted | |||
* true -> Keybindings are checked | * true -> Keybindings are checked | |||
* false -> Key presses are ignored (Keybindings are not checked) | * false -> Key presses are ignored (Keybindings are not checked) | |||
*/ | */ | |||
let keybindingsEnabled = true | let keybindingsEnabled = true | |||
skipping to change at line 59 | skipping to change at line 59 | |||
"alt-u": "request.method.put", | "alt-u": "request.method.put", | |||
"alt-x": "request.method.delete", | "alt-x": "request.method.delete", | |||
"ctrl-k": "flyouts.keybinds.toggle", | "ctrl-k": "flyouts.keybinds.toggle", | |||
"/": "modals.search.toggle", | "/": "modals.search.toggle", | |||
"?": "modals.support.toggle", | "?": "modals.support.toggle", | |||
"ctrl-m": "modals.share.toggle", | "ctrl-m": "modals.share.toggle", | |||
"alt-r": "navigation.jump.rest", | "alt-r": "navigation.jump.rest", | |||
"alt-q": "navigation.jump.graphql", | "alt-q": "navigation.jump.graphql", | |||
"alt-w": "navigation.jump.realtime", | "alt-w": "navigation.jump.realtime", | |||
"alt-d": "navigation.jump.documentation", | "alt-d": "navigation.jump.documentation", | |||
"alt-m": "navigation.jump.profile", | ||||
"alt-s": "navigation.jump.settings", | "alt-s": "navigation.jump.settings", | |||
} | } | |||
/** | /** | |||
* A composable that hooks to the caller component's | * A composable that hooks to the caller component's | |||
* lifecycle and hooks to the keyboard events to fire | * lifecycle and hooks to the keyboard events to fire | |||
* the appropriate actions based on keybindings | * the appropriate actions based on keybindings | |||
*/ | */ | |||
export function hookKeybindingsListener() { | export function hookKeybindingsListener() { | |||
onMounted(() => { | onMounted(() => { | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |