Aller au contenu principal
Version: Next

OBJECT SET SHORTCUT

OBJECT SET SHORTCUT ( {* ;} objet ; touche {; modifiers} )

ParamètreTypeDescription
*Opérateur🡒Si spécifié, objet est un nom d'objet (chaîne)
Si omis, objet est une variable ou un champ
objetObjet de formulaire🡒Nom d'objet (si * est spécifié) ou
Variable ou champ (si * est omis)
toucheChaîne🡒Touche à associer à l’objet
modifiersEntier long🡒Masque ou combinaison de masques de touche(s) de modification

Description

La commande OBJECT SET SHORTCUT permet de définir ou de modifier dynamiquement l’équivalent clavier associé à l’objet ou aux objets désigné(s) par les paramètres objet et * pour le process courant.

Si vous passez le paramètre optionnel *, vous indiquez que le paramètre objet est un nom d’objet (une chaîne). Si vous ne passez pas ce paramètre, vous indiquez que le paramètre objet est une variable ou un champ. Dans ce cas, vous ne passez pas un nom mais une référence.

Passez dans le paramètre touche une chaîne indiquant la touche du clavier à associer à l’objet. Vous pouvez passer soit :

  • un nom de touche standard, par exemple "B"
  • une constante du thème Touches équivalents clavier (ou sa valeur) :
    | Constante | Type | Valeur | Comment |
    | ----------------------------- | ------ | --------------- | ------------- |
    | Shortcut with Backspace | Chaîne | [backspace] |
    |
    | Shortcut with Carriage Return | Chaîne | [return] | |
    | Shortcut with Delete | Chaîne | [del] | |
    | Shortcut with Down arrow | Chaîne | [down arrow] |
    |
    | Shortcut with End | Chaîne | [end] |
    |
    | Shortcut with Enter | Chaîne | [enter] |
    |
    | Shortcut with Escape | Chaîne | [esc] |
    |
    | Shortcut with F1 | Chaîne | [F1] |
    |
    | Shortcut with F10 | Chaîne | [F10] |
    |
    | Shortcut with F11 | Chaîne | [F11] |
    |
    | Shortcut with F12 | Chaîne | [F12] |
    |
    | Shortcut with F13 | Chaîne | [F13] |
    |
    | Shortcut with F14 | Chaîne | [F14] |
    |
    | Shortcut with F15 | Chaîne | [F15] |
    |
    | Shortcut with F2 | Chaîne | [F2] |
    |
    | Shortcut with F3 | Chaîne | [F3] |
    |
    | Shortcut with F4 | Chaîne | [F4] |
    |
    | Shortcut with F5 | Chaîne | [F5] |
    |
    | Shortcut with F6 | Chaîne | [F6] |
    |
    | Shortcut with F7 | Chaîne | [F7] |
    |
    | Shortcut with F8 | Chaîne | [F8] |
    |
    | Shortcut with F9 | Chaîne | [F9] |
    |
    | Shortcut with Help | Chaîne | [help] |
    |
    | Shortcut with Home | Chaîne | [home] |
    |
    | Shortcut with Left arrow | Chaîne | [left arrow] |
    |
    | Shortcut with Page down | Chaîne | [page down] |
    |
    | Shortcut with Page up | Chaîne | [page up] |
    |
    | Shortcut with Right arrow | Chaîne | [right arrow] |
    |
    | Shortcut with Tabulation | Chaîne | [tab] |
    |
    | Shortcut with Up arrow | Chaîne | [up arrow] |
    |

Passez dans le paramètre modifiers une ou plusieurs touche(s) de modification à associer à la touche de raccourci. Pour définir le paramètre modifiers, passez une ou plusieurs des constante(s) de type "Masque" suivantes du thème Evénements (Modifiers) :

ConstanteTypeValeurComment
Command key maskEntier long256Touche Ctrl sous Windows, touche Commande sous OS X
Control key maskEntier long4096Touche Ctrl sous OS X, ou clic droit sous Windows et OS X
Option key maskEntier long2048Touche Alt (aussi appelée Option sous OS X)
Shift key maskEntier long512Windows et OS X

Note : Si vous omettez le paramètre modifiers, l’objet sera activé dès que vous appuierez sur la touche définie. Par exemple, si vous avez associé la touche "H" à un bouton, il sera activé dès que vous appuierez sur la touche H. Ce fonctionnement est à réserver à des interfaces spécifiques.

Exemple

Vous voulez associer un équivalent clavier différent en fonction de la langue courante de l’application. Dans l’événement sur chargement du formulaire, vous pouvez écrire :

 Case of
    :(vLang="FR")
       OBJECT SET SHORTCUT(*;"SortButton";"T";Command key mask+Shift key mask)
  // Ctrl+Maj+T en français
    :(vLang="US")
       OBJECT SET SHORTCUT(*;"SortButton";"O";Command key mask+Shift key mask)
  // Ctrl+Maj+O en anglais
 End case

Voir aussi

OBJECT GET SHORTCUT