kawauchi #6360(2008/05/27 20:06 GMT) [ Ruby ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
require 'Win32API' GetKeyState = Win32API.new('user32', 'GetKeyState', 'I', 'I') pause = false Thread.start { loop { print 'a' unless pause sleep 1 } } loop { key_state = {:p => (GetKeyState.call(?P)[7] == 1), :q => (GetKeyState.call(?Q)[7] == 1) } exit if key_state[:q] if key_state[:p] pause = !pause sleep 0.3 else sleep 0.1 end }
Rating0/0=0.00-0+
1 reply [ reply ]
kawauchi #6360() [ Ruby ] Rating0/0=0.00
Rating0/0=0.00-0+
1 reply [ reply ]