Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Caillat Michel
yafits
Commits
9ae49b93
Commit
9ae49b93
authored
Dec 16, 2019
by
Caillat Michel
Browse files
A class to process whatever happening on the keyboard
parent
36d27f04
Changes
1
Hide whitespace changes
Inline
Side-by-side
yafitsv/views/olqv_keyboardevents.ejs
0 → 100644
View file @
9ae49b93
<script>
class KeyCodeProcessor {
static enter(what) {
console.group(this.name + "." + what);
}
static exit() {
console.groupEnd();
}
constructor (sliceViewer) {
KeyCodeProcessor.enter(this.constructor.name);
this.sliceViewer = sliceViewer;
KeyCodeProcessor.exit()
}
open() {
KeyCodeProcessor.enter(this.open.name);
document.addEventListener('keydown', this.process.bind(this), false);
KeyCodeProcessor.exit();
}
process(event) {
KeyCodeProcessor.enter(this.process.name);
let ctrlKey = event.ctrlKey;
let keyCode = event.keyCode;
console.log(event);
console.log(ctrlKey);
console.log(keyCode);
KeyCodeProcessor.exit();
}
}
</script>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment