diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2026-01-08 21:22:03 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2026-01-08 21:22:03 +0100 |
| commit | 4908dfd72a343ee7c35bc55a55ad860052e21fae (patch) | |
| tree | fc8e9a7af14ce3b70648870593a4724a14a4ff66 /src/Fl_cocoa.mm | |
| parent | 7fae181d9503c436a486c6810c07a3320a27d233 (diff) | |
Add CMake option FLTK_OPTION_PEN_SUPPORT (default: ON)
This option can be used to disable pen/tablet support if there are
build problems on a particular platform or build system (e.g. MinGW)
so users can continue to build FLTK 1.5.
Users can also choose to disable pen support if they don't need it.
Diffstat (limited to 'src/Fl_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 32abcbc88..2a90f5bf1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -72,7 +72,7 @@ extern int fl_send_system_handlers(void *e); // converting cr lf converter function static void createAppleMenu(void); static void cocoaMouseHandler(NSEvent *theEvent); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && defined(FLTK_HAVE_PEN_SUPPORT) static bool cocoaTabletHandler(NSEvent *theEvent, bool lock); extern bool fl_cocoa_tablet_handler(NSEvent*, Fl_Window*); #endif @@ -631,7 +631,7 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop() endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation; #endif - (BOOL)did_view_resolution_change; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && defined(FLTK_HAVE_PEN_SUPPORT) - (void)tabletProximity:(NSEvent *)theEvent; - (void)tabletPoint:(NSEvent *)theEvent; #endif @@ -1057,6 +1057,7 @@ static void cocoaMagnifyHandler(NSEvent *theEvent) #endif } +#if defined(FLTK_HAVE_PEN_SUPPORT) static bool cocoaTabletHandler(NSEvent *theEvent, bool lock) { @@ -1067,6 +1068,8 @@ static bool cocoaTabletHandler(NSEvent *theEvent, bool lock) return ret; } +#endif // FLTK_HAVE_PEN_SUPPORT + namespace Fl { namespace Private { // Global mouse position at mouse down event @@ -1084,6 +1087,7 @@ static void cocoaMouseHandler(NSEvent *theEvent) fl_lock_function(); +#if defined(FLTK_HAVE_PEN_SUPPORT) // Handle tablet proximity and point subevents if ( ([theEvent type] != NSEventTypeMouseEntered) // does not have a subtype && ([theEvent type] != NSEventTypeMouseExited) ) // does not have a subtype @@ -1098,6 +1102,7 @@ static void cocoaMouseHandler(NSEvent *theEvent) // else fall through into mouse event handling } } +#endif // FLTK_HAVE_PEN_SUPPORT Fl_Window *window = (Fl_Window*)[(FLWindow*)[theEvent window] getFl_Window]; if (!window || !window->shown() ) { @@ -2635,7 +2640,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; - (void)mouseExited:(NSEvent *)theEvent { cocoaMouseHandler(theEvent); } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9) && defined(FLTK_HAVE_PEN_SUPPORT) - (void)tabletProximity:(NSEvent *)theEvent { cocoaTabletHandler(theEvent, true); } |
