Skip to content

Commit

Permalink
Fix documentation of the keyboard modifiers
Browse files Browse the repository at this point in the history
Match the implementation :-)

Fixes #4335
  • Loading branch information
tronical committed Jan 19, 2024
1 parent 8e0af0b commit 8cee95e
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions internal/common/builtin_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@
macro_rules! for_each_builtin_structs {
($macro:ident) => {
$macro![
/// KeyboardModifier provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
/// This structure is generated as part of `KeyEvent`
/// On macOS, the command key is mapped to the meta modifier.
/// On Windows, the windows key is mapped to the meta modifier.
/// The `KeyboardModifiers` struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
/// It is provided as part of `KeyEvent`'s `modifiers` field.
///
/// Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms
/// the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS,
/// Slint maps the Command key to the control modifier, and the Control key to the meta modifier.
///
/// On Windows, the Windows key is mapped to the meta modifier.
#[derive(Copy, Eq)]
struct KeyboardModifiers {
@name = "slint::private_api::KeyboardModifiers"
export {
/// Indicates the alt key on a keyboard.
/// Indicates the Alt key on a keyboard.
alt: bool,
/// Indicates the control key on a keyboard.
/// Indicates the Control key on a keyboard, except on macOS, where it is the Command key (⌘).
control: bool,
/// Indicates the shift key on a keyboard.
/// Indicates the Shift key on a keyboard.
shift: bool,
/// Indicates the command key on macos.
/// Indicates the Control key on macos, and the Windows key on Windows.
meta: bool,
}
private {
Expand Down

0 comments on commit 8cee95e

Please sign in to comment.