// Override the key press event from Xsharp. protected override bool OnKeyPress(KeyName key, ModifierMask modifiers, String str) { bool processed = false; if (sink != null) { // Emit the "KeyDown" event. ToolkitKeys keyData = MapKey(key, modifiers); if (sink.ToolkitKeyDown(keyData)) { processed = true; } // Emit the "KeyChar" event if necessary. if (str != null) { foreach (char ch in str) { // Clean old ASCII DEL (0x7F) if (ch != (char)0x7F) { if (sink != null) // window might be closed by sink.ToolkitKeyDown { if (sink.ToolkitKeyChar(ch)) { processed = true; } } } } } } return(processed); }
// Override the key press event from Xsharp. protected override bool OnKeyPress(KeyName key, ModifierMask modifiers, String str) { bool processed = false; if (sink != null) { // Emit the "KeyDown" event. ToolkitKeys keyData = DrawingWindow.MapKey(key, modifiers); if (sink.ToolkitKeyDown(keyData)) { processed = true; } // Emit the "KeyChar" event if necessary. if (str != null) { foreach (char ch in str) { if (sink.ToolkitKeyChar(ch)) { processed = true; } } } } return(processed); }
public bool ToolkitKeyChar(char charCode) { IToolkitEventSink co = this.mControlWeakRef.Target as IToolkitEventSink; if (null != co) { return(co.ToolkitKeyChar(charCode)); } return(false); }
internal bool Char(int wParam, int lParam) { //Console.WriteLine("DrawingWindow.Char " + sink +", "+ ((char)wParam).ToString()); return(sink.ToolkitKeyChar((char)wParam)); }