let characters = unsafe {
let ns_string = NSEvent::characters(event);
let start = NSString::UTF8String(ns_string);
let len = NSString::len(ns_string);
let slice = ::std::slice::from_raw_parts(
start as *const u8,
len
);
::std::str::from_utf8_unchecked(slice)
};
We should do this similarily to how it is done in druid.
Cocoa documentation is here. xcb info about keycodes here, iced keyboard event, druid implementation, useful crate
Snippet to extract string from key event: