Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. International Keyboard Input

International Keyboard Input

Scheduled Pinned Locked Moved C#
designquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rcollina
    wrote on last edited by
    #1

    Hello everyone, I'm wondering if there's a way to obtain user input without using a Form KeyDown event. I'm specifically looking for a method to get printable characters no matter which keyboard layout. I'm developing an user interface for a graphical engine and I'm coding a textbox from scratch. I'm currently using GetKeyboardState, MapVirtualKeyEx and ToAsciiEx from user32, but sometimes I get odd repeated characters and I have no means to tell the repeated characters from the actual input. Is there a managed way to get the same functionality? Thanks in advance, Rob

    P 1 Reply Last reply
    0
    • R rcollina

      Hello everyone, I'm wondering if there's a way to obtain user input without using a Form KeyDown event. I'm specifically looking for a method to get printable characters no matter which keyboard layout. I'm developing an user interface for a graphical engine and I'm coding a textbox from scratch. I'm currently using GetKeyboardState, MapVirtualKeyEx and ToAsciiEx from user32, but sometimes I get odd repeated characters and I have no means to tell the repeated characters from the actual input. Is there a managed way to get the same functionality? Thanks in advance, Rob

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Roberto Collina wrote:

      if there's a way to obtain user input without using a Form KeyDown event

      No, not without digging deep into the bios.

      "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

      R 1 Reply Last reply
      0
      • P Paul Conrad

        Roberto Collina wrote:

        if there's a way to obtain user input without using a Form KeyDown event

        No, not without digging deep into the bios.

        "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

        R Offline
        R Offline
        rcollina
        wrote on last edited by
        #3

        Thank you for your reply. I'm sorry to hear since this is going to be problematic. I was pretty much sure I'd have eventually found a .net counterpart for the user32 methods I mentioned. I'm curious to know how user interface developers in the .net era address to this issue. After all, text input is a basic feature. Thanks again.

        P 1 Reply Last reply
        0
        • R rcollina

          Thank you for your reply. I'm sorry to hear since this is going to be problematic. I was pretty much sure I'd have eventually found a .net counterpart for the user32 methods I mentioned. I'm curious to know how user interface developers in the .net era address to this issue. After all, text input is a basic feature. Thanks again.

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          Roberto Collina wrote:

          I'm sorry to hear since this is going to be problematic.

          I have always thought the OS takes care of any internationalization.

          Roberto Collina wrote:

          curious to know how user interface developers in the .net era address to this issue.

          I wonder if there are any google groups that can shed light.

          "The clue train passed his station without stopping." - John Simmons / outlaw programmer

          R 1 Reply Last reply
          0
          • P Paul Conrad

            Roberto Collina wrote:

            I'm sorry to hear since this is going to be problematic.

            I have always thought the OS takes care of any internationalization.

            Roberto Collina wrote:

            curious to know how user interface developers in the .net era address to this issue.

            I wonder if there are any google groups that can shed light.

            "The clue train passed his station without stopping." - John Simmons / outlaw programmer

            R Offline
            R Offline
            rcollina
            wrote on last edited by
            #5

            Paul Conrad wrote:

            I have always thought the OS takes care of any internationalization.

            But it does. The scanToAscii method returns modifier-aware input. If you press shift and then a, you get "A". It's indeed very handy. My main problem is that it behaves oddily. So, to reiterate, I was wondering how this can be done in a managed way - I don't care if it eventually boils down to those user32 calls. I think WPF has an Input.Keyboard class somewhere, I was looking for something similar for previous .net versions. Still, thanks for your reply. I will check the google groups for info as well. Regards.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups