You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
873 B

  1. require 'cucul'
  2. require 'caca.so'
  3. module Caca
  4. class Event
  5. def Event.to_i
  6. const_get("TYPE")
  7. end
  8. def Event.|(i)
  9. i = i.to_i
  10. const_get("TYPE")|i
  11. end
  12. def quit?
  13. false
  14. end
  15. class Key
  16. attr_reader :ch, :utf32, :utf8
  17. def initialize(ch, utf32, utf8)
  18. @ch, @utf32, @utf8 = ch, utf32, utf8
  19. end
  20. end
  21. class Mouse
  22. attr_reader :x, :y, :button
  23. def initialize(x, y, button)
  24. @x, @y, @button = x, y, button
  25. end
  26. end
  27. class Resize
  28. attr_reader :w, :h
  29. def initialize(w, h)
  30. @w, @h = w, h
  31. end
  32. end
  33. class Quit
  34. def quit?
  35. true
  36. end
  37. end
  38. end
  39. end