const key = require('keymaster');
const actions = require('./actions');

function setupKeys(store) {
    console.log('binding keys');
    key.unbind('esc');

    key('esc', () => document.activeElement.blur());
    key('esc', () => store.dispatch(actions.setCombiner([])));
    key('esc', () => store.dispatch(actions.setReclaiming(false)));
    key('esc', () => store.dispatch(actions.setActiveSkill(null)));
    key('esc', () => store.dispatch(actions.setInfo(null)));
    key('esc', () => store.dispatch(actions.setItemEquip(null)));
    key('esc', () => store.dispatch(actions.setItemUnequip([])));
    key('esc', () => store.dispatch(actions.setVboxHighlight([])));
    key('esc', () => store.dispatch(actions.setVboxSelected([])));
    key('esc', () => store.dispatch(actions.setMtxActive(null)));
}

module.exports = setupKeys;
