Class: Plushie::Event::Modifiers

Inherits:
Data
  • Object
show all
Defined in:
lib/plushie/event.rb

Overview

Modifier key state change events. Triggered when modifier keys (shift, ctrl, alt, command) change state. Subscribe via Subscription.on_modifiers_changed.

Examples:

Modifiers changed

in Event::Modifiers[modifiers: { shift: true }]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(modifiers:, captured: false, window_id: nil) ⇒ Modifiers

Returns a new instance of Modifiers.



182
183
184
# File 'lib/plushie/event.rb', line 182

def initialize(modifiers:, captured: false, window_id: nil)
  super
end

Instance Attribute Details

#capturedObject (readonly)

Returns the value of attribute captured

Returns:

  • (Object)

    the current value of captured



181
182
183
# File 'lib/plushie/event.rb', line 181

def captured
  @captured
end

#captured [Boolean] true if a widget consumed this event([Boolean]) ⇒ Object (readonly)

Modifier key state change events. Triggered when modifier keys (shift, ctrl, alt, command) change state. Subscribe via Subscription.on_modifiers_changed.

Examples:

Modifiers changed

in Event::Modifiers[modifiers: { shift: true }]


181
182
183
184
185
# File 'lib/plushie/event.rb', line 181

Modifiers = Data.define(:modifiers, :captured, :window_id) do
  def initialize(modifiers:, captured: false, window_id: nil)
    super
  end
end

#modifiersObject (readonly)

Returns the value of attribute modifiers

Returns:

  • (Object)

    the current value of modifiers



181
182
183
# File 'lib/plushie/event.rb', line 181

def modifiers
  @modifiers
end

#modifiers [Hash] current modifier state ({shift: true, control: false, alt: false, command: false})([Hash]({shift: true, control: false, alt: false, command: false})) ⇒ Object (readonly)

Modifier key state change events. Triggered when modifier keys (shift, ctrl, alt, command) change state. Subscribe via Subscription.on_modifiers_changed.

Examples:

Modifiers changed

in Event::Modifiers[modifiers: { shift: true }]


181
182
183
184
185
# File 'lib/plushie/event.rb', line 181

Modifiers = Data.define(:modifiers, :captured, :window_id) do
  def initialize(modifiers:, captured: false, window_id: nil)
    super
  end
end

#window_idObject (readonly)

Returns the value of attribute window_id

Returns:

  • (Object)

    the current value of window_id



181
182
183
# File 'lib/plushie/event.rb', line 181

def window_id
  @window_id
end

#window_id [String, nil] window that was focused when the event fired([String, nil]) ⇒ Object (readonly)

Modifier key state change events. Triggered when modifier keys (shift, ctrl, alt, command) change state. Subscribe via Subscription.on_modifiers_changed.

Examples:

Modifiers changed

in Event::Modifiers[modifiers: { shift: true }]


181
182
183
184
185
# File 'lib/plushie/event.rb', line 181

Modifiers = Data.define(:modifiers, :captured, :window_id) do
  def initialize(modifiers:, captured: false, window_id: nil)
    super
  end
end