Skip to content

Commit

Permalink
Default false gamepads
Browse files Browse the repository at this point in the history
  • Loading branch information
hitman249 committed Aug 9, 2021
1 parent 2c7de70 commit 36bc414
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/src/helpers/collects.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export default class Collects {

static fsr = {
'': 'Disabled',
'fsr-0': '0 - Quality',
'fsr-0': '0 - Max blur',
'fsr-1': '1',
'fsr-2': '2',
'fsr-3': '3 - Balanced',
'fsr-4': '4',
'fsr-5': '5 - Performance',
'fsr-5': '5 - Max sharp',
};

static commands = {
Expand Down
7 changes: 5 additions & 2 deletions src/src/modules/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ export default class Config {
}

this.sort = _.get(this.config, 'app.sort', 500);

this.config.app.disable_gamepads = this.isDisabledGamepads();
}

getDefaultConfig() {
Expand All @@ -211,7 +213,7 @@ export default class Config {
sort: 500,
time: 0,
icon_height: 88,
disable_gamepads: false,
disable_gamepads: true,
},
exports: {},
wine: {
Expand Down Expand Up @@ -898,7 +900,8 @@ export default class Config {
* @return {boolean}
*/
isDisabledGamepads() {
return Boolean(_.get(this.config, 'app.disable_gamepads', false));
let status = _.get(this.config, 'app.disable_gamepads');
return undefined === status ? true : Boolean(status);
}

/**
Expand Down
31 changes: 1 addition & 30 deletions src/src/modules/gamepads/key-mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,37 +168,8 @@ export default class KeyMapping {
});

if (gamepad.axes && gamepad.axes.length > 0) {
const count = gamepad.axes.length;
Array.from(gamepad.axes).forEach((button, index) => {
if (count > 3) {
switch (index) {
case 0:
axes[index] = 'a|d';
break;
case 1:
axes[index] = 'w|s';
break;
case 2:
axes[index] = 'mouse_inverted_x|3';
break;
case 3:
axes[index] = 'mouse_inverted_y|3';
break;
default:
axes[index] = '';
}
} else {
switch (index) {
case 0:
axes[index] = 'mouse_inverted_x|3';
break;
case 1:
axes[index] = 'mouse_inverted_y|3';
break;
default:
axes[index] = '';
}
}
axes[index] = '';
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/src/modules/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs');

export default class Update {

version = '1.5.8';
version = '1.5.9';

/**
* @type {string}
Expand Down

0 comments on commit 36bc414

Please sign in to comment.