Sha256: 079199e0e3fa4e06f00ef48c6d4b0ca4f662d12e422b87da9b09b2cef7464761

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 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


# b33=box({left: 99, top: 99})
#
# b33.touch(true) do
#   t.keyboard({ remove: :up }) do
#     event = Native(native_event)
#     puts "heyeeee up!!"
#   end
# end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
atome-0.5.7.6.5 vendor/assets/src/medias/utils/examples/particles/keyboard/example.rb
atome-0.5.7.6.0 vendor/assets/application/examples/keyboard.rb
atome-0.5.7.5.9 vendor/assets/application/examples/keyboard.rb