diff options
author | nyamatongwe <devnull@localhost> | 2000-12-06 10:41:55 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2000-12-06 10:41:55 +0000 |
commit | 1e05fc2407748e4486ca05c35f00f1d58f6dcdbe (patch) | |
tree | 7df14f34c4e55170463f1b175f0c6202c274c9e9 | |
parent | 347020eeb7a844589288309afc9dc1bbb7ecda3a (diff) | |
download | scintilla-mirror-1e05fc2407748e4486ca05c35f00f1d58f6dcdbe.tar.gz |
KeyPress now returns TRUE when ordinary characters are typed.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 2bfdc8101..b9844c84a 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -668,12 +668,13 @@ void ScintillaGTK::NotifyKey(int key, int modifiers) { int ScintillaGTK::KeyDefault(int key, int modifiers) { if (!(modifiers & SCI_CTRL) && !(modifiers & SCI_ALT) && (key < 256)) { AddChar(key); + return 1; } else { // Pass up to container in case it is an accelerator NotifyKey(key, modifiers); + return 0; } //Platform::DebugPrintf("SK-key: %d %x %x\n",key, modifiers); - return 1; } void ScintillaGTK::Copy() { @@ -1047,7 +1048,7 @@ static int KeyTranslate(int keyIn) { } gint ScintillaGTK::KeyPress(GtkWidget *, GdkEventKey *event, ScintillaGTK *sciThis) { - //Platform::DebugPrintf("SC-key: %d %x %x\n",event->keyval, event->state, GTK_WIDGET_FLAG(sciThis)); + //Platform::DebugPrintf("SC-key: %d %x\n",event->keyval, event->state); bool shift = event->state & GDK_SHIFT_MASK; bool ctrl = event->state & GDK_CONTROL_MASK; bool alt = event->state & GDK_MOD1_MASK; @@ -1060,10 +1061,10 @@ gint ScintillaGTK::KeyPress(GtkWidget *, GdkEventKey *event, ScintillaGTK *sciTh key = KeyTranslate(key); bool consumed = false; - sciThis->KeyDown(key, shift, ctrl, alt, &consumed); - //Platform::DebugPrintf("SK-key: %d %x %x\n",event->keyval, event->state, GTK_WIDGET_FLAGS(widget)); - //if (consumed) - // gtk_signal_emit_stop_by_name(GTK_OBJECT(w), "key_press_event"); + int added = sciThis->KeyDown(key, shift, ctrl, alt, &consumed); + if (!consumed) + consumed = added; + //Platform::DebugPrintf("SK-key: %d %x %x\n",event->keyval, event->state, consumed); return consumed; } |