diff --git a/src/lib/components/Keyboard.ts b/src/lib/components/Keyboard.ts index 94142f5e..7a082e14 100644 --- a/src/lib/components/Keyboard.ts +++ b/src/lib/components/Keyboard.ts @@ -684,7 +684,7 @@ class SimpleKeyboard { * Calling onKeyReleased */ if (button && typeof this.options.onKeyReleased === "function") - this.options.onKeyReleased(button); + this.options.onKeyReleased(button, e); } /** diff --git a/src/lib/interfaces.ts b/src/lib/interfaces.ts index 4a8c4dd0..01fa3026 100644 --- a/src/lib/interfaces.ts +++ b/src/lib/interfaces.ts @@ -276,6 +276,16 @@ export interface KeyboardOptions { */ onChangeAll?: (inputObj: KeyboardInput, e?: MouseEvent) => any; + /** + * Retrieves the pressed key + */ + onKeyPress?: (button: string, e?: MouseEvent) => any; + + /** + * Retrieves the released key + */ + onKeyReleased?: (button: string, e?: MouseEvent) => any; + /** * Module options can have any format */