Class: Plushie::Event::Ime

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

Overview

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, id: nil, scope: [], text: nil, cursor: nil, captured: false, window_id: nil) ⇒ Ime

Returns a new instance of Ime.



134
135
136
137
# File 'lib/plushie/event.rb', line 134

def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
  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



133
134
135
# File 'lib/plushie/event.rb', line 133

def captured
  @captured
end

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

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end

#cursorObject (readonly)

Returns the value of attribute cursor

Returns:

  • (Object)

    the current value of cursor



133
134
135
# File 'lib/plushie/event.rb', line 133

def cursor
  @cursor
end

#cursor [Array<Integer>, nil] cursor position within preedit([Array<Integer>, nil]) ⇒ Object (readonly)

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end

#idObject (readonly)

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



133
134
135
# File 'lib/plushie/event.rb', line 133

def id
  @id
end

#id [String, nil] widget ID that has IME focus([String, nil]) ⇒ Object (readonly)

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end

#scopeObject (readonly)

Returns the value of attribute scope

Returns:

  • (Object)

    the current value of scope



133
134
135
# File 'lib/plushie/event.rb', line 133

def scope
  @scope
end

#scope [Array<String>] reversed ancestor scope chain([Array<String>]) ⇒ Object (readonly)

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



133
134
135
# File 'lib/plushie/event.rb', line 133

def text
  @text
end

#text [String, nil] composed or committed text([String, nil]) ⇒ Object (readonly)

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



133
134
135
# File 'lib/plushie/event.rb', line 133

def type
  @type
end

#type [Symbol] :opened, :preedit, :commit, :closed([Symbol], : preedit, : commit, : closed) ⇒ Object (readonly)

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    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



133
134
135
# File 'lib/plushie/event.rb', line 133

def window_id
  @window_id
end

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

IME (Input Method Editor) events for international text input. Triggered by IME composition sessions (CJK input, accent composition, etc.). Subscribe via Subscription.on_ime.

Examples:

IME commit

in Event::Ime[type: :commit, text:]

Preedit composition

in Event::Ime[type: :preedit, text:, cursor:]


133
134
135
136
137
138
# File 'lib/plushie/event.rb', line 133

Ime = Data.define(:type, :id, :scope, :text, :cursor, :captured, :window_id) do
  def initialize(type:, id: nil, scope: [], text: nil, cursor: nil,
    captured: false, window_id: nil)
    super
  end
end