STR 1952: Fixed first modifier key event, some minor utf8 orrections.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6416 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
3fda0918b6
commit
a26d5408a1
1
CHANGES
1
CHANGES
@ -1,5 +1,6 @@
|
||||
CHANGES IN FLTK 1.3.0
|
||||
|
||||
- Fixed first modifier key event (STR #1952)
|
||||
- Fl_Group and Fl_Scroll now resize themselves before
|
||||
resizing their children (STR #2032)
|
||||
- "fltk-config --post foo" now creates an application
|
||||
|
@ -75,6 +75,8 @@
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
int fl_unichar_to_utf8_size(Fl_Unichar);
|
||||
|
||||
/* F2: comes from FLTK2 */
|
||||
/* OD: comes from OksiD */
|
||||
|
||||
|
@ -165,7 +165,7 @@ static unsigned short macKeyLookUp[128] =
|
||||
/**
|
||||
* convert the current mouse chord into the FLTK modifier state
|
||||
*/
|
||||
static void mods_to_e_state( UInt32 mods )
|
||||
static unsigned int mods_to_e_state( UInt32 mods )
|
||||
{
|
||||
long state = 0;
|
||||
if ( mods & kEventKeyModifierNumLockMask ) state |= FL_NUM_LOCK;
|
||||
@ -174,8 +174,10 @@ static void mods_to_e_state( UInt32 mods )
|
||||
if ( mods & (controlKey|rightControlKey) ) state |= FL_CTRL;
|
||||
if ( mods & (shiftKey|rightShiftKey) ) state |= FL_SHIFT;
|
||||
if ( mods & alphaLock ) state |= FL_CAPS_LOCK;
|
||||
Fl::e_state = ( Fl::e_state & 0xff000000 ) | state;
|
||||
unsigned int ret = ( Fl::e_state & 0xff000000 ) | state;
|
||||
Fl::e_state = ret;
|
||||
//printf( "State 0x%08x (%04x)\n", Fl::e_state, mods );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1212,7 +1214,7 @@ pascal OSStatus carbonKeyboardHandler(
|
||||
Fl_Window *window = (Fl_Window*)userData;
|
||||
Fl::first_window(window);
|
||||
UInt32 mods;
|
||||
static UInt32 prevMods = 0xffffffff;
|
||||
static UInt32 prevMods = mods_to_e_state( GetCurrentKeyModifiers() );
|
||||
|
||||
fl_lock_function();
|
||||
|
||||
@ -1221,7 +1223,6 @@ pascal OSStatus carbonKeyboardHandler(
|
||||
// get the modifiers for any of the events
|
||||
GetEventParameter( event, kEventParamKeyModifiers, typeUInt32,
|
||||
NULL, sizeof(UInt32), NULL, &mods );
|
||||
if ( prevMods == 0xffffffff ) prevMods = mods;
|
||||
|
||||
// get the key code only for key events
|
||||
UInt32 keyCode = 0;
|
||||
|
11
src/fl_utf.c
11
src/fl_utf.c
@ -23,10 +23,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/**
|
||||
\defgroup fl_unichar Unicode Character Functions
|
||||
Global Functions Handling Single Unicode Characters
|
||||
@ -56,7 +53,7 @@ extern "C" {
|
||||
//FL_EXPORT int fl_utf8_size(Fl_Unichar uc);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif // 0
|
||||
|
||||
/* Set to 1 to turn bad UTF8 bytes into ISO-8859-1. If this is to zero
|
||||
they are instead turned into the Unicode REPLACEMENT CHARACTER, of
|
||||
@ -839,7 +836,3 @@ int fl_utf8test(const char* src, unsigned srclen) {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user