Handling dead keys in SDL

Discussion in 'Game Development (Technical)' started by ggambett, Jun 11, 2005.

  1. James C. Smith

    Moderator Original Member

    Joined:
    Aug 21, 2004
    Messages:
    1,768
    Likes Received:
    0
    Silly me. All this time I was assuming that ggambett was trying to detect when then ' key was pressed but his app didn’t get notified until the A was pressed. I just re-read is initial message and it seems the exact opposite is going on. The ' key is typing a ' character when it should not. Sorry. I misunderstood.

    Is handling WM_DEADCHAR message likely to help this? It seems like he wants to ignore it in this case.
     
  2. ggambett

    Moderator Original Member Indie Author

    Joined:
    Jul 26, 2004
    Messages:
    1,982
    Likes Received:
    6
    Exactly. I get MORE dead key characters than I need :) Somewhere, some piece of code should eat a dead char + normal char and give me a modified char, but it's giving me both the dead char and the normal char.
     
  3. jetro

    Original Member

    Joined:
    Jan 21, 2005
    Messages:
    130
    Likes Received:
    0
    I'd like to know did you get this problem sorted out some way?

    And did you verify you have correctly called SDL_EnableUNICODE(1); before using the unicode field from events. I'm still wonderin why you seem to get different behavior than I.
     
  4. Savant

    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    Might as well use this old thread for this...

    Anyone have any experience with SdlDotNet? I'm using it via C# and either I'm missing something or the keyboard input is horribly broken.

    I see no way to extract the ascii char value from the KeyboardEventArgs arg that is passed to my keyboard event handler. I can get the SDL "Key.whatever" value out of it but I can't get the text representation in case I want to, oh I don't know, accept input from the user and store it in a string.

    Has anyone gotten this to work? The "unicode" member mentioned above seems to be missing SdlDotNet.
     
  5. Olofson

    Original Member

    Joined:
    Dec 11, 2005
    Messages:
    270
    Likes Received:
    0
    I have no idea what SdlDotNet does, but the actual SDL API requires that you explicitly enable Unicode using SDL_EnableUNICODE(1), or that unicode field won't contain anything useful.

    As to the original dead keys issue, this is indeed a limitation in the SDL implementation. There is a patch for Win32, and work in progress for X11.

    http://article.gmane.org/gmane.comp.lib.sdl/25289
     
  6. Savant

    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    Grrrr..

    (blah blah why don't the mods just lift this stupid too short restriction blah blah)
     
  7. soniCron

    Indie Author

    Joined:
    May 4, 2005
    Messages:
    3,664
    Likes Received:
    0
    To prevent posts like "Grrrr..."? ;) Seriously, though, how 'bout it guys?
     
  8. jetro

    Original Member

    Joined:
    Jan 21, 2005
    Messages:
    130
    Likes Received:
    0
    Seriously, I can't see where is the problem. I have the dead keys working just fine with SDL apps after calling SDL_EnableUNICODE(1).

    Haven't checked if it works correctly on linux & mac, but at least on win32 it works fine!
     
  9. Savant

    Original Member

    Joined:
    Feb 8, 2005
    Messages:
    1,674
    Likes Received:
    0
    Yeah, and a bang up job it does too! :rolleyes:

    SdlDotNet. Please read the question before responding.
     

Share This Page

  • About Indie Gamer

    When the original Dexterity Forums closed in 2004, Indie Gamer was born and a diverse community has grown out of a passion for creating great games. Here you will find over 10 years of in-depth discussion on game design, the business of game development, and marketing/sales. Indie Gamer also provides a friendly place to meet up with other Developers, Artists, Composers and Writers.
  • Buy us a beer!

    Indie Gamer is delicately held together by a single poor bastard who thankfully gets help from various community volunteers. If you frequent this site or have found value in something you've learned here, help keep the site running by donating a few dollars (for beer of course)!

    Sure, I'll Buy You a Beer