54e3099c56
- Controller lifetime is bound to route lifetime - View lifetime is bound to controller lifetime - Control lifetime is bound to view lifetime - Enhanced event dispatching - Enhanced responsiveness in some places - Views communicate user input to controllers via new event system
21 lines
384 B
JavaScript
21 lines
384 B
JavaScript
'use strict';
|
|
|
|
const mousetrap = require('mousetrap');
|
|
const settings = require('../models/settings.js');
|
|
|
|
function bind(hotkey, func) {
|
|
if (settings.get().keyboardShortcuts) {
|
|
mousetrap.bind(hotkey, func);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function unbind(hotkey) {
|
|
mousetrap.unbind(hotkey);
|
|
}
|
|
|
|
module.exports = {
|
|
bind: bind,
|
|
unbind: unbind,
|
|
};
|