source: libcaca/trunk/ruby/lib/caca.rb @ 2019

Last change on this file since 2019 was 2019, checked in by Pascal Terjan, 13 years ago
  • Finish Caca::Event (a.k.a. J'ai fait caca aujourd'hui)
File size: 735 bytes
Line 
1require 'cucul'
2require 'caca.so'
3
4module Caca
5    class Event
6        def Event.to_i
7            const_get("TYPE")
8        end
9        def Event.|(i)
10            i = i.to_i
11            const_get("TYPE")|i
12        end
13        class Key
14            attr_reader :ch, :utf32, :utf8
15            def initialize(ch, utf32, utf8)
16                @ch, @utf32, @utf8 = ch, utf32, utf8
17            end
18        end
19        class Mouse
20            attr_reader :x, :y, :button
21            def initialize(x, y, button)
22                @x, @y, @button = x, y, button
23            end
24        end
25        class Resize
26            attr_reader :w, :h
27            def initialize(w, h)
28                @w, @h = w, h
29            end
30        end
31    end
32end
Note: See TracBrowser for help on using the repository browser.