<commit_before>
import AddKeyDown from 'input/keyboard/events/AddKeyDown.js';
import KeyCombo from 'input/keyboard/combo/KeyCombo.js';
import ProcessKeyCombo from 'input/keyboard/combo/ProcessKeyCombo.js';

function checkCombo (event, combo) {

    let result = ProcessKeyCombo(event, combo);

    if (result)
    {
        console.log('COMBO MATCHED!');
    }

}

//  37 = LEFT
//  38 = UP
//  39 = RIGHT
//  40 = DOWN

let combo = KeyCombo([ 38, 38, 38, 40, 40, 40, 37, 37, 37, 39, 39, 39 ]);

//  They get 1 second to press the next key in the combo or it resets
combo.maxKeyDelay = 1000;

console.log(combo);

AddKeyDown(window, e => checkCombo(e, combo));

console.log('Keyboard ready');<commit_msg>KeyCombo can now take its optional settings as a config object, after the Keycodes. Updated one of the examples to use this format.<commit_after>
import AddKeyDown from 'input/keyboard/events/AddKeyDown.js';
import KeyCombo from 'input/keyboard/combo/KeyCombo.js';
import ProcessKeyCombo from 'input/keyboard/combo/ProcessKeyCombo.js';

function checkCombo (event, combo) {

    let result = ProcessKeyCombo(event, combo);

    if (result)
    {
        console.log('COMBO MATCHED!');
    }

}

//  37 = LEFT
//  38 = UP
//  39 = RIGHT
//  40 = DOWN

let combo = KeyCombo([ 38, 38, 38, 40, 40, 40, 37, 37, 37, 39, 39, 39 ], { maxKeyDelay: 1000 });

//  They get 1 second to press the next key in the combo or it resets
// combo.maxKeyDelay = 1000;

console.log(combo);

AddKeyDown(window, e => checkCombo(e, combo));

console.log('Keyboard ready');
{'fraction_non_alphanumeric': 0.13208762886597938, 'fraction_numerical': 0.05025773195876289, 'mean_word_length': 3.5676470588235296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7040878', 'n_tokens_mistral': 612, 'n_tokens_neox': 537, 'n_words': 167}