• no (unregistered)

    this is why you frist rtfm

  • A nunny moose (unregistered)

    Keys.Home mapping to $ isn't the real issue.

    The problem is that such key presses are typically stored in the keyboard as a 0x00 + another character. So pressing Home would add 0x00 0x24 to the keyboard buffer. So the code could work assuming argument e has a property denoting a special key and the code would check the value said property.

  • (nodebb)

    Keyboards are actually pretty complicated. I could write a whole essay about scan codes, key codes, key modifiers, evolution in hardware abstraction from DOS to NT, but the simple gist is that you have the classic Windows key codes plus the classic DOS modifier flags to work with under .NET. And yes, those are correctly mapped for other platforms as well.

    So that is the reason why you a key code plus modifier flags in the key args as well for the key events for those wondering.

    https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.keyeventargs?view=windowsdesktop-9.0

  • Joey (unregistered)

    I vaguely remember there not being KeyCodes and KeyUp/KeyDown events in the original .NET frameworks, and you had to do funky stuff with the KeyChars in that event. This might be carry over from that era?

  • (nodebb) in reply to A nunny moose

    Yeah I wonder how that plays out with the screen KBs that all the cool kids use now.

  • Álvaro González (github) in reply to MaxiTB

    Yes, keyboards must be complicated for sure. Microsoft Teams hasn't been able to make some basic features work in non-US layouts, so what are the chances for a small development shop?

  • (nodebb)

    Why check for keyboard accelerators manually? It's obviously using Windows, and Windows has functions to automatically handle keyboard shortcuts in the Windows OS itself. in fact the application loop typically handles all that stuff and stuffs the keyboard shortcut events into the queue automatically so you don't even need to know how the command was entered.

  • Fa (unregistered)

    Ctrl-D "end of transmission" is really nice. When you don't feel like typing exit or quit in the terminal, just hit ctrl-D and you're out

  • Officer Johnny Holzkopf (unregistered) in reply to Fa
    Comment held for moderation.

Leave a comment on “The Wrong Kind of Character”

Log In or post as a guest

Replying to comment #:

« Return to Article