<commit_before>var Cheapo = Cheapo || {};

Cheapo.Input = (function() {

  'use strict';

  /**
    * Keyboard state
    */

  var _keys = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];

  /**
    * Mapping between modern keyboard and weird prehistoric hex keyboard
    */

  var _mapping = {
    69: 0x1,
    82: 0x2,
    84: 0x3,
    68: 0x4,
    70: 0x5,
    71: 0x6,
    67: 0x7,
    86: 0x8,
    66: 0x9,
    89: 0xA,
    85: 0xB,
    73: 0xC,
    72: 0xD,
    74: 0xE,
    75: 0xF,
    78: 0x0
  };

  return {

    // Callback function called on key press
    callback: null,

    init: function() {

      document.addEventListener('keydown', function(event) {
        if (event.keyCode in _mapping) {

          _keys[_mapping[event.keyCode]] = true;

          if (this.callback)
            this.callback(_mapping[event.keyCode]);
        }
      }.bind(this));

      document.addEventListener('keyup', function(event) {
        if (event.keyCode in _mapping) {

          _keys[_mapping[event.keyCode]] = false;
        }
      });
    },

    reset: function() {

      for (var i = 0; i < _keys.length; ++i)
        _keys[i] = false;

      this.callback = null;
    },

    down: function(key) {

      return _keys[key];
    }

  };

})();
<commit_msg>- change key bindings (from 3 to N)<commit_after>var Cheapo = Cheapo || {};

Cheapo.Input = (function() {

  'use strict';

  /**
    * Keyboard state
    */

  var _keys = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];

  /**
    * Mapping between modern keyboard and weird prehistoric hex keyboard
    */

  var _mapping = {
    86: 0x0,
    51: 0x1,
    52: 0x2,
    53: 0x3,
    69: 0x4,
    82: 0x5,
    84: 0x6,
    68: 0x7,
    70: 0x8,
    71: 0x9,
    67: 0xA,
    66: 0xB,
    54: 0xC,
    89: 0xD,
    72: 0xE,
    78: 0xF
  };

  return {

    // Callback function called on key press
    callback: null,

    init: function() {

      document.addEventListener('keydown', function(event) {
        if (event.keyCode in _mapping) {

          _keys[_mapping[event.keyCode]] = true;

          if (this.callback)
            this.callback(_mapping[event.keyCode]);
        }
      }.bind(this));

      document.addEventListener('keyup', function(event) {
        if (event.keyCode in _mapping) {

          _keys[_mapping[event.keyCode]] = false;
        }
      });
    },

    reset: function() {

      for (var i = 0; i < _keys.length; ++i)
        _keys[i] = false;

      this.callback = null;
    },

    down: function(key) {

      return _keys[key];
    }

  };

})();

{'fraction_non_alphanumeric': 0.1429101707498144, 'fraction_numerical': 0.04417223459539718, 'mean_word_length': 1.977900552486188, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3042661', 'n_tokens_mistral': 1048, 'n_tokens_neox': 929, 'n_words': 243}