NiGui icon indicating copy to clipboard operation
NiGui copied to clipboard

Not all keys implemented

Open qqtop opened this issue 4 years ago • 10 comments

Keys on the numberpad with or without Numlock do not trigger any key.events. so pressing on the Enter key on the numpad of a full size keyboard would yield:

Window Key Down event: key: 65421(invalid data!) ...

and similar for the other keys there.

qqtop avatar Sep 02 '19 08:09 qqtop

Yes, the numpad keys needs to be added in the implementation.

simonkrauter avatar Sep 02 '19 10:09 simonkrauter

in addition, most of the symbol key and all of the function keys are also invalid.

sk-Prime avatar Sep 02 '19 11:09 sk-Prime

@qqtop, @sk-Prime: I have implemented most of the keys now. Please test which keys are still missing or work wrong, which probably depends on keyboard layout. I tested only with German keyboard layout.

simonkrauter avatar Sep 02 '19 21:09 simonkrauter

this keys and their shift version are not working (shift version is after '|') i made a patch quote left to caps lock should work now

  • quote left : ` | ~
  • quote right : ' | "
  • bracket left : [ | {
  • bracket right : ] | }
  • semicolon : ; | :
  • caps lock
  • AltL and AltR
  • f10

in regards f10, take a look here Docs Microsoft WM_KEYDOWN

If the F10 key is pressed, the DefWindowProc function sets an internal flag. When DefWindowProc receives the WM_KEYUP message, the function checks whether the internal flag is set and, if so, sends a WM_SYSCOMMAND message to the top-level window. The WM_SYSCOMMAND parameter of the message is set to SC_KEYMENU.

sk-Prime avatar Sep 02 '19 23:09 sk-Prime

I am testing this on a Corsair K68 mechanical keyboard with US layout on linux. sk-Prime's list works fine here , having said that, some key combinations do emit the (invalid data!) notice in the example_06_keyboard_events.nim program. E.g. here this key shows the notice ,however, works ok /|?
The numpad works fine now.

qqtop avatar Sep 03 '19 00:09 qqtop

i tested that in acer windows laptop. i don't know how you managed to work. in nigui.nim there is no Key_CapsLock thus i added it as Key_CapsLock = 20 and then it works in my laptop. same goes to other key which i mentioned above.

sk-Prime avatar Sep 03 '19 02:09 sk-Prime

@sk-Prime: Thanks for the hint. I have added Key_CapsLock now.

simonkrauter avatar Sep 05 '19 20:09 simonkrauter

Key_QuoteLeft = 192 ` Key_QuoteRight = 222 ' Key_BracketLeft = 219 [ Key_BracketRight = 221 ] Key_Semicolon = 186 ;

add this keys too.

sk-Prime avatar Sep 06 '19 09:09 sk-Prime

Related commit: https://github.com/trustable-code/NiGui/commit/4d79522d656684524766f77f8538403e7449fe18

simonkrauter avatar Oct 29 '19 18:10 simonkrauter

` ´

Seems to also not work (tested on windows on a german keyboard with deadkeys)

enthus1ast avatar Nov 08 '19 17:11 enthus1ast