Native Client

PP_InputEvent_Character Struct Reference

The PP_InputEvent_Character struct represents a typed character event. More...


Detailed Description

The PP_InputEvent_Character struct represents a typed character event.

Normally, the program will receive a key down event, followed by a character event, followed by a key up event. The character event will have any modifier keys applied. Obvious examples are symbols, where Shift-5 gives you a '%'. The key down and up events will give you the scan code for the "5" key, and the character event will give you the '%' character.

You may not get a character event for all key down events if the key doesn't generate a character. Likewise, you may actually get multiple character events in a row. For example, some locales have an accent key that modifies the next character typed. You might get this stream of events: accent down, accent up (it didn't generate a character), letter key down, letter with accent character event (it was modified by the previous accent key), letter key up. If the letter can't be combined with the accent, like an umlaut and an 'R', the system might send unlaut down, umlaut up, 'R' key down, umlaut character (can't combine it with 'R', so just send the raw unlaut so it isn't lost"), 'R' character event, 'R' key up.

Data Fields List

uint32_t modifier
char text [5]

Data Fields Details

A combination of the PP_InputEvent_Modifier flags.

This value represents the typed character as a single null-terminated UTF-8 character.

Any unused bytes will be filled with null bytes. Since the maximum UTF-8 character is 4 bytes, there will always be at least one null at the end so you can treat this as a null-termianted UTF-8 string.


The documentation for this struct was generated from the following file:

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.