@@ -16,6 +16,9 @@ declare const emulators: Emulators;
1616export type EmulatorFunction = "dosboxWorker" | "dosboxDirect" | "dosboxNode" | "janus" | "backend" ;
1717
1818export interface DosOptions {
19+ sensitivityValue ?: number ;
20+ mirroredControls ?: boolean ;
21+ scaleControls ?: number ;
1922 aspect ?: number ;
2023 noWebGL ?: boolean ;
2124 emulatorFunction ?: EmulatorFunction ;
@@ -66,12 +69,18 @@ export class DosInstance {
6669 this . mobileControls = pointers . bind . mobile ;
6770 this . autolock = false ;
6871
69- this . mirroredControls = this . storage . getItem ( "mirroredControls" ) === "true" ;
72+ this . mirroredControls =
73+ this . options . mirroredControls === true ||
74+ this . storage . getItem ( "mirroredControls" ) === "true" ;
7075
71- const scaleControlsValue = Number . parseFloat ( this . storage . getItem ( "scaleControls" ) ?? "1.0" ) ;
76+ const scaleControlsValue =
77+ this . options . scaleControls ??
78+ Number . parseFloat ( this . storage . getItem ( "scaleControls" ) ?? "1.0" ) ;
7279 this . scaleControls = Number . isNaN ( scaleControlsValue ) ? 1.0 : scaleControlsValue ;
7380
74- const sensitivityValue = Number . parseFloat ( this . storage . getItem ( "sensitivity" ) ?? "1.0" ) ;
81+ const sensitivityValue =
82+ this . options . sensitivityValue ??
83+ Number . parseFloat ( this . storage . getItem ( "sensitivity" ) ?? "1.0" ) ;
7584 this . sensitivity = Number . isNaN ( sensitivityValue ) ? 1.0 : sensitivityValue ;
7685
7786 const volumeValue = Number . parseFloat ( this . storage . getItem ( "volume" ) ?? "1.0" ) ;
0 commit comments