Commit 9ae49b93 authored by Caillat Michel's avatar Caillat Michel
Browse files

A class to process whatever happening on the keyboard

parent 36d27f04
<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>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment