diff --git a/lib/provider/native/libnut-keyboard-action.class.ts b/lib/provider/native/libnut-keyboard-action.class.ts index a71cef5f..b13c1fd2 100644 --- a/lib/provider/native/libnut-keyboard-action.class.ts +++ b/lib/provider/native/libnut-keyboard-action.class.ts @@ -101,7 +101,7 @@ export default class KeyboardAction implements KeyboardActionProvider { [Key.Print, "printscreen"], [Key.Pause, null], [Key.Insert, "insert"], - [Key.Delete, null], + [Key.Delete, "delete"], [Key.Home, "home"], [Key.End, "end"], [Key.PageUp, "pageup"], diff --git a/lib/provider/native/libnut-keyboard.action.class.spec.ts b/lib/provider/native/libnut-keyboard.action.class.spec.ts index f4f1e124..57058ac8 100644 --- a/lib/provider/native/libnut-keyboard.action.class.spec.ts +++ b/lib/provider/native/libnut-keyboard.action.class.spec.ts @@ -175,4 +175,30 @@ describe("libnut keyboard action", () => { expect(SUT.releaseKey(Key.A)).rejects.toThrowError("Test error"); }); }); + + describe("bugfix #260", () => { + it("should forward the pressKey call to libnut for 'delete'", () => { + // GIVEN + const SUT = new KeyboardAction(); + + // WHEN + SUT.pressKey(Key.Delete); + + // THEN + expect(libnut.keyToggle).toBeCalledTimes(1); + expect(libnut.keyToggle).toBeCalledWith("delete", "down", []); + }); + + it("should forward the releaseKey call to libnut for 'delete'", () => { + // GIVEN + const SUT = new KeyboardAction(); + + // WHEN + SUT.releaseKey(Key.Delete); + + // THEN + expect(libnut.keyToggle).toBeCalledTimes(1); + expect(libnut.keyToggle).toBeCalledWith("delete", "up", []); + }); + }); });