andlabs / libui

Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
Other
10.7k stars 613 forks source link

long term possibility: uiArea text event handling #74

Open andlabs opened 8 years ago

andlabs commented 8 years ago

This is for gathering information needed in order to allow a future version of uiArea to be used for text input as well as raw keyboard input.

Cocoa https://developer.apple.com/library/mac/documentation/TextFonts/Conceptual/CocoaTextArchitecture/TextEditing/TextEditing.html#//apple_ref/doc/uid/TP40009459-CH3-SW3 https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSTextInputContext_Class/ https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html#//apple_ref/doc/uid/20000468

andlabs commented 8 years ago

Windows http://www.catch22.net/tuts/unicode-text-editing The problem here is that TranslateMessage() is documented as ALWAYS returning TRUE on a key-down event, so there's no way to know whether we should ignore the current one because a WM_CHAR is coming up or not :| ImmContext functions judging from tsfapp samples? Are we just supposed to know which keys contribute to text?

andlabs commented 8 years ago

Potential problem: Cocoa uses predefined navigational and editing shortcuts, some of which come as part of the text event system and others as part of menus.

andlabs commented 8 years ago

GTK+ GtkIMContext GtkSettings gtk-im-module GtkIMMulticontext gtk_im_multicontext_set_context_id()

andlabs commented 8 years ago

Windows there's shell facilities for touch screens that automatically pop up a keyboard on EDIT controls:

see if there's a way we can opt into this behavior for other window classes