Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Commit

Permalink
Add hint on how to do shortcuts without modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
sdassow authored and andydotxyz committed Nov 17, 2023
1 parent c1aacef commit 2a82720
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions explore/shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Notice that this shortcut can be re-used so you could attach it to menus or othe

As you can see there are two parts to registering a shortcut in this way - passing the shortcut definition and also a callback function. If the user types the keyboard shortcut then the function will be called and the output printed.

Shortcuts only work in combination with modifier keys. In order to react to keyboard input without modifiers use `canvas.OnTypedRune` or `canvas.OnTypedKey`.

## Adding shortcuts to an Entry

It can also be helpful to have a shortcut apply only when the current item is focused. This approach can be used for any focusable widget, and is managed by extending that widget and adding a `TypedShortcut` handler. This is much like adding key handlers, except the value passed in will be a `fyne.Shortcut`.
Expand Down

0 comments on commit 2a82720

Please sign in to comment.