Skip to main content
100%

Cinder's KeyEvent.h modified to hold a std::string (UTF8) rather than a char (ASCII)

✓ Published0🌍 Public
RRandomEtc
Last edited Aug 19, 2011
Created on Aug 16, 2011

This example shows a modified version of Cinder's `KeyEvent.h` header file, where the key character storage is changed from a single `char` to a `std::string` to support UTF-8 input. The code defines a `KeyEvent` class that stores a string (`mString`) alongside integer key codes and modifier flags, and it provides methods like `getString()` and `getChar()` to access the typed character. It also includes enums for key codes and modifier masks, along with a static method `translateNativeKeyCode()` for platform-specific key mapping. The implementation uses Cinder's `Event` base class and standard C++ string handling.

AI-generated description

Similar vizzes