summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-02-18 07:11:09 +0000
committerBill Spitzak <spitzak@gmail.com>2000-02-18 07:11:09 +0000
commit0bd9018d649616ec81430bc5c3a2ad2b4f46575a (patch)
treee6f86630a8c5b305f7aea5b9c2b4337271b31513 /src
parent415db360a1c48dec11ef97857efa575221edc1e2 (diff)
Fixed the Ctrl+P shortcut problem reported by dalitz@infotech.de
The previous keystroke is not confused with a navigation control key when the window focus changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1003 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl.cxx9
-rw-r--r--src/Fl_Group.cxx6
-rw-r--r--src/Fl_Input.cxx7
-rw-r--r--src/Fl_x.cxx8
4 files changed, 18 insertions, 12 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index dd630f286..3d22c29e7 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,6 +1,6 @@
#include <stdio.h>
//
-// "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $"
+// "$Id: Fl.cxx,v 1.24.2.16 2000/02/18 07:11:08 bill Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -352,6 +352,8 @@ void fl_fix_focus() {
if (Fl::grab()) return; // don't do anything while grab is on.
+ Fl::e_keysym = 0; // make sure it is not confused with navigation key
+
// set focus based on Fl::modal() and fl_xfocus
Fl_Widget* w = fl_xfocus;
if (w) {
@@ -480,12 +482,11 @@ int Fl::handle(int event, Fl_Window* window)
window = 0;
case FL_FOCUS:
fl_xfocus = window;
- e_keysym = 0; // make sure it is not confused with navigation key
fl_fix_focus();
return 1;
case FL_KEYBOARD:
- fl_xfocus = window; // this should already be set, but just in case.
+ fl_xfocus = window; // this should not happen! But maybe it does:
// Try it as keystroke, sending it to focus and all parents:
for (w = grab() ? grab() : focus(); w; w = w->parent())
@@ -705,5 +706,5 @@ int fl_old_shortcut(const char* s) {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.15 2000/02/15 08:31:45 bill Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.16 2000/02/18 07:11:08 bill Exp $".
//
diff --git a/src/Fl_Group.cxx b/src/Fl_Group.cxx
index 8ff018746..495127fe4 100644
--- a/src/Fl_Group.cxx
+++ b/src/Fl_Group.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Group.cxx,v 1.8.2.3 1999/08/09 06:19:32 bill Exp $"
+// "$Id: Fl_Group.cxx,v 1.8.2.4 2000/02/18 07:11:09 bill Exp $"
//
// Group widget for the Fast Light Tool Kit (FLTK).
//
@@ -67,6 +67,8 @@ static int send(Fl_Widget* o, int event) {
#define ctrl(x) (x^0x40)
static int navkey() {
switch (Fl::event_key()) {
+ case 0: // not an FL_KEYBOARD/FL_SHORTCUT event
+ break;
case FL_Tab:
if (!Fl::event_state(FL_SHIFT)) return FL_Right;
case 0xfe20: // XK_ISO_Left_Tab
@@ -503,5 +505,5 @@ void Fl_Group::draw_outside_label(const Fl_Widget& w) const {
}
//
-// End of "$Id: Fl_Group.cxx,v 1.8.2.3 1999/08/09 06:19:32 bill Exp $".
+// End of "$Id: Fl_Group.cxx,v 1.8.2.4 2000/02/18 07:11:09 bill Exp $".
//
diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx
index f7c5656c5..dd573150c 100644
--- a/src/Fl_Input.cxx
+++ b/src/Fl_Input.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input.cxx,v 1.10.2.4 1999/10/30 20:21:29 bill Exp $"
+// "$Id: Fl_Input.cxx,v 1.10.2.5 2000/02/18 07:11:09 bill Exp $"
//
// Input widget for the Fast Light Tool Kit (FLTK).
//
@@ -149,7 +149,8 @@ int Fl_Input::handle_key() {
}
}
- if (Fl::event_state(FL_ALT|FL_META)) { // reserved for shortcuts
+ if (Fl::event_state(FL_ALT|FL_META)
+ && !(Fl::event_length() && (key&128))) { // reserved for shortcuts
compose = pcompose;
return 0;
}
@@ -345,5 +346,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l)
}
//
-// End of "$Id: Fl_Input.cxx,v 1.10.2.4 1999/10/30 20:21:29 bill Exp $".
+// End of "$Id: Fl_Input.cxx,v 1.10.2.5 2000/02/18 07:11:09 bill Exp $".
//
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index f77568f47..a1e33518e 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_x.cxx,v 1.24.2.11 2000/01/26 06:27:14 bill Exp $"
+// "$Id: Fl_x.cxx,v 1.24.2.12 2000/02/18 07:11:09 bill Exp $"
//
// X specific code for the Fast Light Tool Kit (FLTK).
//
@@ -451,7 +451,9 @@ int fl_handle(const XEvent& xevent)
fl_key_vector[keycode/8] |= (1 << (keycode%8));
static char buffer[21];
KeySym keysym;
- int len = XLookupString((XKeyEvent*)&(xevent.xkey),buffer,20,&keysym,0);
+ //static XComposeStatus compose;
+ int len = XLookupString((XKeyEvent*)&(xevent.xkey),
+ buffer, 20, &keysym, 0/*&compose*/);
if (keysym && keysym < 0x400) { // a character in latin-1,2,3,4 sets
// force it to type a character (not sure if this ever is needed):
if (!len) {buffer[0] = char(keysym); len = 1;}
@@ -878,5 +880,5 @@ void Fl_Window::make_current() {
#endif
//
-// End of "$Id: Fl_x.cxx,v 1.24.2.11 2000/01/26 06:27:14 bill Exp $".
+// End of "$Id: Fl_x.cxx,v 1.24.2.12 2000/02/18 07:11:09 bill Exp $".
//