Sha256: b13f83cb9b3ff5144985d5fe51aae6e4159d71330c9f303ddd353380bfe93df4

Contents?: true

Size: 1.2 KB

Versions: 81

Compression:

Stored size: 1.2 KB

Contents

#  frozen_string_literal: true

t = text :hello
t.left(99)

t.edit(true)

t.keyboard(:press) do |native_event|
  event = Native(native_event)
  puts "press : #{event[:key]} :  #{event[:keyCode]}"
end

t.keyboard(:down) do |native_event|
  event = Native(native_event)
  if event[:keyCode].to_s == '13'
    event.preventDefault()
    t.color(:red)
  end

end

t.keyboard(:up) do |native_event|
  event = Native(native_event)
  puts "up!!"
end

t.keyboard(true) do |native_event|
  event = Native(native_event)
  puts " true => #{event[:keyCode]}"
  puts "true => #{event[:key]}"

end

# t.keyboard(:input) do |native_event|
#   event = Native(native_event)
#   puts event
# end

# t.keyboard(:keydown) do |native_event|
#   event = Native(native_event)
#   puts "down : #{event[:keyCode]}"
# end

c = circle({ top: 123, left: 0, width: 55, height: 55 })
c2 = circle({ top: 123, left: 80, width: 55, height: 55 })
c3 = circle({ top: 123, left: 150, width: 55, height: 55 })

c.touch(true) do
  text({ data: 'stop up', top: 150 })
  t.keyboard({ remove: :up })
end
c2.touch(true) do
  text({ data: 'remove all', top: 150 })
  t.keyboard(:remove)
end
c3.touch(true) do
  t.edit(false)
  text({ data: 'stop editing', top: 150 })
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
atome-0.5.7.0.4 vendor/assets/application/examples/keyboard.rb
atome-0.5.7.0.3 vendor/assets/application/examples/keyboard.rb
atome-0.5.7.0.2 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.8.7 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.8.6 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.8.5 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.8.3 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.8 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.7 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.6 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.5 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.4 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.7.3 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.6.9 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.6.7 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.6.5 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.6.1 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.6.0 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.5.7 vendor/assets/application/examples/keyboard.rb
atome-0.5.6.5.6 vendor/assets/application/examples/keyboard.rb