From d892e05d8ab10c6e0a0f18f53e392a83cceacec3 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Fri, 7 Nov 2014 19:13:08 +0000 Subject: Doc mods regarding the OS issue of Ctrl-Click simulation of Right-Click on Mac OSX, as per recommendations from the forum posts on fltk.coredev Subject: [RFC] Right click emulation for one button mouse on Mac where both Manolo and Albrecht suggest documentation mods to reflect the issue. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10439 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/src/osissues.dox | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'documentation/src/osissues.dox') diff --git a/documentation/src/osissues.dox b/documentation/src/osissues.dox index 07fd508bf..ac3000210 100644 --- a/documentation/src/osissues.dox +++ b/documentation/src/osissues.dox @@ -682,6 +682,52 @@ US keyboard will set \c FL_ALT in Fl::event_state(), set Fl::event_key() to 'y' and return the Yen symbol in Fl::event_text(). +Right Click simulation with Ctrl Click +\par +The Apple HIG guidelines indicate applications should support +'Ctrl Click' to simulate 'Right Click' for e.g. context menus, +so users with one-button mice and one-click trackpads can still +access right-click features. However, paraphrasing + +Manolo's comment on the fltk.coredev newsgroup: +\par + +\par +Ian MacArthur provided the following handle() method code snippet +showing an example of how to do this: +\code + case FL_PUSH: + { + int btn = Fl::event_button(); +#ifdef __APPLE__ + int ev_state = Fl::event_state(); +#endif + // + // Context menu can be called up in one of two ways: - + // 1 - right click, as normally used on Windows and Linux + // 2 - Ctrl + left click, as sometimes used on Mac + // +#ifdef __APPLE__ + // On apple, check right click, and ctrl+left click + if ((btn == FL_RIGHT_MOUSE) || (ev_state == (FL_CTRL | FL_BUTTON1))) +#else + // On other platforms, only check right click as ctrl+left is used for selections + if (btn == FL_RIGHT_MOUSE) +#endif + { + // Did we right click on the object?.. +\endcode +\par +There is a thread about this subject on fltk.coredev (Aug 1-14, 2014) +entitled "[RFC] Right click emulation for one button mouse on Mac". + Apple "Quit" Event \par -- cgit v1.2.3