Message-ID:
<CAKCUQMY=0Pi60Do7GBT3Z7JimVu4mT655ARonVCH-acsFBcEEA at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
so yes?
#5 did you test this code?
No, I’m currently working on low-level stuff (a table with multiple
searchable fields, a MS-COM style system, some other stuff), and I
don’t know what library (or language) your example was in, so I’m not
willing to spend the time to compile my version. My example was,
however, based directly off of your own.
#1 i’m not looking for SDL_Keyboard.Scancode and i’m not sure why i
"should"
#2 if (HIGH_STATUS_BIT != HIGH_STATUS_BIT) //this is always false right?
#3 why is char32_t or it’s C# version “better” than char?
#4 " fout << “the key pressed was " << status << " " << (char)status <<” is
intended to show the int contained in status in regular and char form, does
it not work?
Patrick covered this stuff pretty well.> Date: Fri, 10 Aug 2012 15:21:44 -0500
From: R Manard
To: SDL Development List
Subject: Re: [SDL] SDL2 and unicode characters from key events
Date: Fri, 10 Aug 2012 15:26:09 -0500
From: R Manard
To: SDL Development List
Subject: Re: [SDL] SDL2 and unicode characters from key events
Message-ID:
<CAKCUQMaRP+h=2W-5B7JOShprLv6UeP6=JjvGp2M6EBkgj3Pdqw at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
I don’t understand “react” or “look for”. I’m sorry. Can you say this in
code for me or tell me more please?
On Fri, Aug 10, 2012 at 1:19 AM, Sam Lantinga wrote:
If you want to react to the key on the upper left of the keyboard with ~
and ` printed on it (on my keyboard), you should look for the
scancode SDL_SCANCODE_GRAVE in the event.key.keysym.scancode field of key
events.
react: act in reaction to something. “If you want to act in reaction
to the ~ key being pressed, then look for the SDL_SCANCODE_GRAVE
scancode.”
look for: To search for something. “If you want to find the scancode
that was generated by a key-press, then look in the key.keysym field
of the event that was created in response to the key-press.”
Date: Fri, 10 Aug 2012 15:46:37 -0500
From: Patrick Baggett <baggett.patrick at gmail.com>
To: SDL Development List
Subject: Re: [SDL] SDL2 and unicode characters from key events
Message-ID:
<CAEk2StnNG=pjP8qMoSCD2VGt39=Aazdmzsm34J5br+ZBnxmMfw at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”
On Fri, Aug 10, 2012 at 3:21 PM, R Manard wrote:
#3 why is char32_t or it’s C# version “better” than char?
I’m assuming because a UTF32 representation can represent any unicode
value, while a “char” generally means “8 bits” and can’t fully represent
any unicode character.
Precisely the reason. I initially used char as well, but before I hit
send it occurred to me that Unicode was involved, so I needed
something bigger.
#4 " fout << "the key pressed was " << status << " " << (char)status <<"
is intended to show the int contained in status in regular and char form,
does it not work?
Outside of en_US and especially in CJK languages, 99% of the time a unicode
value can’t be represented by a C/C++ “char” variable. Thus, this will show
the value as a true unicode value (is the word I’m looking for code point?)
I believe so, though I would say “the numeric value assigned to the
character” or something else verbose like that, since Manard seems to
be wrestling with English.
Basically, the version listed at #4 will list a number, then whatever
the Unicode character BECOMES when it is FORCED into a char.