<commit_before>import EventEmitter from './event_emitter.js';
import Utils from './utils.js';


var utils = new Utils();

const DEFAULT_CONFIG = {
  'axisThreshold': 0.15,
  'gamepadAttributesEnabled': true,
  'gamepadIndicesEnabled': true,
  'keyEventsEnabled': true,
  'nonstandardEventsEnabled': true,
  'indices': undefined,
  'keyEvents': undefined
};

var DEFAULT_STATE = {
  buttons: new Array(17),
  axes: [0.0, 0.0, 0.0, 0.0]
};

for (var i = 0; i < 17; i++) {
  DEFAULT_STATE.buttons[i] = {
    pressed: false,
    value: 0.0
 };
}


export default class Gamepads extends EventEmitter {
  constructor(config) {<commit_msg>support Gamepads with more than 17 buttons<commit_after>import EventEmitter from './event_emitter.js';
import Utils from './utils.js';


var utils = new Utils();

const DEFAULT_CONFIG = {
  'axisThreshold': 0.15,
  'gamepadAttributesEnabled': true,
  'gamepadIndicesEnabled': true,
  'keyEventsEnabled': true,
  'nonstandardEventsEnabled': true,
  'indices': undefined,
  'keyEvents': undefined
};

var DEFAULT_STATE = {
  // The standard gamepad has 4 axes and 17 buttons.
  // Some gamepads have 5-6 axes and 18-20 buttons.
  buttons: new Array(20),
  axes: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
};

for (var i = 0, n = buttons.length; i < n; i++) {
  DEFAULT_STATE.buttons[i] = {
    pressed: false,
    value: 0.0
 };
}


export default class Gamepads extends EventEmitter {
  constructor(config) {
{'fraction_non_alphanumeric': 0.14225648213034336, 'fraction_numerical': 0.03433777154870357, 'mean_word_length': 3.8904109589041096, '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': '1833385', 'n_tokens_mistral': 524, 'n_tokens_neox': 492, 'n_words': 141}