diff options
| author | Greg Ercolano <erco@seriss.com> | 2014-11-07 19:13:08 +0000 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2014-11-07 19:13:08 +0000 |
| commit | d892e05d8ab10c6e0a0f18f53e392a83cceacec3 (patch) | |
| tree | ab9542c72a69738ec1d03c2c8fd65b7919cfea96 | |
| parent | 13cd0a16b544539cb5ae120e4e5477b4db3a3e9e (diff) | |
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
| -rw-r--r-- | documentation/src/osissues.dox | 46 |
1 files changed, 46 insertions, 0 deletions
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 +<A HREF="http://www.fltk.org/newsgroups.php?gfltk.coredev+v:14725"> +Manolo's comment on the fltk.coredev newsgroup</A>: +\par +<UL><LI> + <I>FLTK does /not/ support Ctrl-Click == Right Click itself because Mac OS + X event processing doesn't support this at the system level: the system + reports left-clicks with the ctrl modifier when the user ctrl-clicks, and + OS X system preferences don't allow changing this behavior. Therefore, + applications must handle simulation of Right Click with Ctrl Click + in the application code.</I> +</LI></UL> +\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 |
