Sha256: de610ef9952b1c999aba9f10040aac99684395cb53ca8b9854d6a8db10827742

Contents?: true

Size: 1.63 KB

Versions: 6

Compression:

Stored size: 1.63 KB

Contents

module Vedeu

  module Bindings

    # System events relating to movement of cursors or interfaces.
    #
    # @api public
    # {include:file:docs/events/movement.md}
    # :nocov:
    module Movement

      Vedeu.bind(:_cursor_down_) do |name|
        Vedeu::Move.by_name(Vedeu::Cursor, :down, name)
      end

      Vedeu.bind(:_cursor_left_) do |name|
        Vedeu::Move.by_name(Vedeu::Cursor, :left, name)
      end

      Vedeu.bind(:_cursor_origin_) do |name|
        Vedeu::Move.by_name(Vedeu::Cursor, :origin, name)
      end

      # @todo This event queries Vedeu. Events should only be commands.
      Vedeu.bind(:_cursor_position_) do |name|
        Vedeu.cursors.by_name(name).position
      end

      Vedeu.bind(:_cursor_reposition_) do |name, y, x|
        Vedeu::Reposition.to(Vedeu::Cursor, name, y, x)
      end

      Vedeu.bind(:_cursor_reset_) do |name|
        Vedeu.trigger(:_cursor_origin_, name)
      end

      Vedeu.bind(:_cursor_right_) do |name|
        Vedeu::Move.by_name(Vedeu::Cursor, :right, name)
      end

      Vedeu.bind(:_cursor_up_) do |name|
        Vedeu::Move.by_name(Vedeu::Cursor, :up, name)
      end

      Vedeu.bind(:_geometry_down_) do |name|
        Vedeu::Move.by_name(Vedeu::Geometry, :down, name)
      end

      Vedeu.bind(:_geometry_left_) do |name|
        Vedeu::Move.by_name(Vedeu::Geometry, :left, name)
      end

      Vedeu.bind(:_geometry_right_) do |name|
        Vedeu::Move.by_name(Vedeu::Geometry, :right, name)
      end

      Vedeu.bind(:_geometry_up_) do |name|
        Vedeu::Move.by_name(Vedeu::Geometry, :up, name)
      end

    end # Movement
    # :nocov:

  end # Bindings

end # Vedeu

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vedeu-0.4.52 lib/vedeu/bindings/movement.rb
vedeu-0.4.51 lib/vedeu/bindings/movement.rb
vedeu-0.4.50 lib/vedeu/bindings/movement.rb
vedeu-0.4.49 lib/vedeu/bindings/movement.rb
vedeu-0.4.48 lib/vedeu/bindings/movement.rb
vedeu-0.4.47 lib/vedeu/bindings/movement.rb