@@ -46,8 +46,10 @@ export class KeyboardClass {
4646 try {
4747 if ( inputIsString ( input ) ) {
4848 for ( const char of input . join ( " " ) . split ( "" ) ) {
49- await sleep ( this . config . autoDelayMs ) ;
50- await this . providerRegistry . getKeyboard ( ) . type ( char ) ;
49+ if ( this . config . autoDelayMs > 0 ) {
50+ await sleep ( this . config . autoDelayMs ) ;
51+ }
52+ await this . providerRegistry . getKeyboard ( ) . type ( char ) ;
5153 }
5254 } else {
5355 await this . providerRegistry . getKeyboard ( ) . click ( ...input as Key [ ] ) ;
@@ -73,7 +75,9 @@ export class KeyboardClass {
7375 public pressKey ( ...keys : Key [ ] ) : Promise < KeyboardClass > {
7476 return new Promise < KeyboardClass > ( async ( resolve , reject ) => {
7577 try {
76- await sleep ( this . config . autoDelayMs ) ;
78+ if ( this . config . autoDelayMs > 0 ) {
79+ await sleep ( this . config . autoDelayMs ) ;
80+ }
7781 await this . providerRegistry . getKeyboard ( ) . pressKey ( ...keys ) ;
7882 resolve ( this ) ;
7983 } catch ( e ) {
@@ -96,7 +100,9 @@ export class KeyboardClass {
96100 public releaseKey ( ...keys : Key [ ] ) : Promise < KeyboardClass > {
97101 return new Promise < KeyboardClass > ( async ( resolve , reject ) => {
98102 try {
99- await sleep ( this . config . autoDelayMs ) ;
103+ if ( this . config . autoDelayMs > 0 ) {
104+ await sleep ( this . config . autoDelayMs ) ;
105+ }
100106 await this . providerRegistry . getKeyboard ( ) . releaseKey ( ...keys ) ;
101107 resolve ( this ) ;
102108 } catch ( e ) {
0 commit comments