Update doc about Ctrl/+/-/0/ zoom shortcuts

This commit is contained in:
ManoloFLTK 2024-03-03 08:15:42 +01:00
parent 257e20e929
commit 4db9391525
2 changed files with 17 additions and 18 deletions

View File

@ -1086,12 +1086,8 @@ public:
can be set to a value FLTK will multiply to the OS-given value.
The 2 variants of functions Fl::screen_scale() allow to programmatically get and set
scaling factor values. The scaling factor value can be further changed at runtime
by typing ctrl-/+/-/0/ (cmd-/+/-/0/ under macOS). FLTK sends the
\ref FL_ZOOM_EVENT when the factor value is changed, to which a
callback can be associated with Fl::add_handler().
By default, FLTK displays the new scaling factor value in a yellow, transient window.
This can be changed with option Fl::OPTION_SHOW_SCALING.
See also Fl::OPTION_SIMPLE_ZOOM_SHORTCUT.
by typing \c Ctrl/+/-/0/ (\c Cmd/+/-/0/ under macOS).
See \ref events_fl_shortcut for more details about these shortcuts.
@{ */
static int x(); // via screen driver
static int y(); // via screen driver

View File

@ -191,16 +191,19 @@ A global shortcut will work no matter what windows are displayed
or which one has the focus.
Since version 1.4, FLTK has 3 default global shortcuts (\c Ctrl/+/-/0/
or \c Cmd/+/-/0/ under macOS) that change the value of the GUI scaling
[\c Cmd/+/-/0/ under macOS]) that change the value of the GUI scaling
factor. \c Ctrl+ zooms-in all app windows of the focussed display
(all displays under macOS);
\c Ctrl- zooms-out these windows; \c Ctrl 0 restores the initial value of the
scaling factor. Although characters '+' and '0' are located in
the shifted position of their keyboard key in some
keyboard layouts, these shortcuts are to be used without pressing
the shift key, for user convenience. In other words, press only
\c Ctrl (or \c Cmd) and the key labelled '+' or '0' independently of
whether '+' or '0' is in shifted or unshifted position on the keyboard.
scaling factor. If any window of the display is fullscreen or maximized,
scaling shortcuts have no effect. It's possible to deactivate FLTK's default
scaling shortcuts with function Fl::keyboard_screen_scaling().
Option Fl::OPTION_SIMPLE_ZOOM_SHORTCUT can
facilitate the typing necessary to trigger the zoom-in operation
with those keyboard layouts where character '+' is located in
the shifted position of its key: when this option is On
it's not necessary to press also the Shift key to zoom-in.
These scaling shortcuts are installed when the FLTK
library opens the display. They have a lower priority than any shortcut
@ -208,12 +211,12 @@ defined in any menu and than any user-provided event handler
(see Fl::add_handler()) installed after FLTK opened the display.
Therefore, if a menu item of an FLTK app is given FL_COMMAND+'+'
as shortcut, that item's callback rather than FLTK's default zooming-in
routine is triggered when \c Ctrl+ (or \c Cmd+) is pressed .
If any window of the display is fullscreen or maximized,
scaling shortcuts have no effect.
routine is triggered when \c Ctrl+ (\c Cmd+ under macOS) is pressed.
It's possible to deactivate FLTK's default scaling shortcuts with function
Fl::keyboard_screen_scaling();
FLTK sends the \ref FL_ZOOM_EVENT when the scaling factor value changes, to which a
callback can be associated with Fl::add_handler().
By default, FLTK displays the new scaling factor value in a yellow, transient window.
This can be changed with option Fl::OPTION_SHOW_SCALING.
\section events_widget Widget Events