File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { IpcRenderer } from 'electron'
2
- import { GamepadActionStatus } from 'src/types'
2
+ import { AppSettings , GamepadActionStatus } from 'src/types'
3
3
import {
4
4
checkGameCube ,
5
5
checkPS3 ,
@@ -25,6 +25,12 @@ const SCROLL_REPEAT_DELAY = 50
25
25
let controllerIsDisabled = false
26
26
27
27
export const initGamepad = ( ) => {
28
+ ipcRenderer
29
+ . invoke ( 'requestSettings' , 'default' )
30
+ . then ( ( { disableController } : AppSettings ) => {
31
+ controllerIsDisabled = disableController || false
32
+ } )
33
+
28
34
// store the current controllers
29
35
let controllers : number [ ] = [ ]
30
36
@@ -272,9 +278,9 @@ export const initGamepad = () => {
272
278
console . log ( `button ${ button } pressed ${ buttons [ button ] . value } ` )
273
279
}
274
280
for ( const axis in axes ) {
275
- if ( axes [ axis ] < - 0.1 && axes [ axis ] >= - 1 )
281
+ if ( axes [ axis ] < - 0.2 && axes [ axis ] >= - 1 )
276
282
console . log ( `axis ${ axis } activated negative` )
277
- if ( axes [ axis ] > 0.1 && axes [ axis ] <= 1 )
283
+ if ( axes [ axis ] > 0.2 && axes [ axis ] <= 1 )
278
284
console . log ( `axis ${ axis } activated positive` )
279
285
}
280
286
}
You can’t perform that action at this time.
0 commit comments