<commit_before>'use strict';

// Dependencies
const FlowKeypress = require('flow-keypress');

module.exports = (event, state, args, next) => {
    args = args || {};
    args.defaultContext = args.defaultContext || 'graph';
    state.keypress = FlowKeypress(args);
    state.events = args.events || {};

    // setup event interface
    // TODO this is temporary
    Object.keys(state.events).forEach(eventName => {
        state.keypress.on(eventName, eventData => {
            event.flow(state.events[eventName], eventData);
        });
    });

    next();
};<commit_msg>Fixes in the flow-keypress handlers.<commit_after>'use strict';

// Dependencies
const FlowKeypress = require('flow-keypress');

module.exports = (event, state, args, next) => {
    args = args || {};

    state.keypress = FlowKeypress(args);

    // setup event interface
    state.keypress.on('keyEvent', eventData => {
        event.flow(eventData.name, eventData.data);
    });

    next();
};
{'fraction_non_alphanumeric': 0.15946502057613168, 'fraction_numerical': 0.0, 'mean_word_length': 3.1404255319148935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6883215', 'n_tokens_mistral': 295, 'n_tokens_neox': 286, 'n_words': 60}