nut.js icon indicating copy to clipboard operation
nut.js copied to clipboard

Creating square brackets

Open LenniM opened this issue 2 years ago • 3 comments

Version 2.1.1

Short overview Not able to create square brackets through "pressKey"-event and "type"-event.

Issue occurs on This issue occurred on the Windows operating system.

Replication

const { keyboard , Key} = require('@nut-tree/nut-js');

const ret = globalShortcut.register('Up', async () => {

        await keyboard.type(Key.RightBracket)

        // await keyboard.pressKey(Key.RightBracket) --> isn't working either
        // await keyboard.releaseKey(Key.RightBracket) --> isn't working either

})

LenniM avatar Jun 27 '22 17:06 LenniM

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 31 '22 02:07 github-actions[bot]

Hey @LenniM 👋

Could you please provide some additional context?

Which keyboard layout are you using? And does it generate any unexpected output instead?

Best regards

Simon

s1hofmann avatar Aug 05 '22 18:08 s1hofmann

Hi @s1hofmann,

thanks for commenting!

Sure, I am trying to create a shortcut, triggering a specific action for a specific program (which is triggered through "]").

I am using a German keyboard layout (which could be the cause of the problem). When I use "keyboard.type(Key.RightBracket)" it returns a 9.

The typical way to create a "]" on a German keyboard is pressing right alt and 9. Thus, I have tried to create a bracket through using "keyboard.type(Key.Alt, Key.RightBracket)" - but that also generates a 9.

It doesn't return any error or any other unexpected output.

I hope this helps. If you have any further questions, then feel free to ask.

Best regards

Lenni

LenniM avatar Aug 05 '22 19:08 LenniM