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.setActiveSkill(null)));
    key('esc', () => store.dispatch(actions.setInfo(null)));
    key('esc', () => store.dispatch(actions.setItemUnequip([])));
    key('esc', () => store.dispatch(actions.setVboxSelected({ storeSelect: [], stashSelect: [] })));
    key('esc', () => store.dispatch(actions.setVboxHighlight(null)));
    key('esc', () => store.dispatch(actions.setVboxCombiner(null)));
    key('esc', () => store.dispatch(actions.setVboxInfo(null)));
    key('esc', () => store.dispatch(actions.setMtxActive(null)));
}

module.exports = setupKeys;
