Strict Standards: Non-static method phpbb_feed_factory::init() should not be called statically in /home/jacius/rubygame/forums/feed.php on line 66
[phpBB Debug] PHP Notice: in file /feed.php on line 171: Cannot modify header information - headers already sent by (output started at /feed.php:66)
[phpBB Debug] PHP Notice: in file /feed.php on line 172: Cannot modify header information - headers already sent by (output started at /feed.php:66)
Rubygame Forums 2010-09-06T23:37:37+00:00 http://rubygame.org/forums/feed.php?f=3&t=146 2010-09-06T23:37:37+00:00 http://rubygame.org/forums/viewtopic.php?t=146&p=607#p607 <![CDATA[Re: Rubygame get_key_state]]>
blue-wiz wrote:
I reckon that it's great. Maybe it should go into the global Rubygame module.
Code:
Rubygame::get_key_state


Just pester jacius on IRC or email to get it into the source code :lol:


:P yeah, I might have to! And the main Rubygame module does seem like the best place to put it. I think I'll throw it in there and send jacius a pull request, maybe he'll see that.

Statistics: Posted by tyler — Mon Sep 06, 2010 11:37 pm


]]>
2010-09-06T18:07:11+00:00 http://rubygame.org/forums/viewtopic.php?t=146&p=606#p606 <![CDATA[Re: Rubygame get_key_state]]>
Code:
Rubygame::get_key_state


Just pester jacius on IRC or email to get it into the source code :lol:

Statistics: Posted by blue-wiz — Mon Sep 06, 2010 6:07 pm


]]>
2010-09-05T20:48:34+00:00 http://rubygame.org/forums/viewtopic.php?t=146&p=605#p605 <![CDATA[Re: Rubygame get_key_state]]> Statistics: Posted by tyler — Sun Sep 05, 2010 8:48 pm


]]>
2010-07-24T00:37:33+00:00 http://rubygame.org/forums/viewtopic.php?t=146&p=562#p562 <![CDATA[Rubygame get_key_state]]>
Code:
def get_key_state
   hash = {}
   key_state = SDL.GetKeyState
   key_state.length.times do |i|
      state = (key_state[i] != 0)
      hash[Rubygame::Events._convert_key_symbol(i)] = state
   end
   hash.delete :unknown_key
   return hash
end


It returns a hash of all the key states, so one could do something like:

Code:
get_key_state[:a] #=> true, if a is pressed


I humbly request that this be included in rubygame, if it's not too much of a hassle for you jacius, since I believe others could find this useful. I'd provide a patchfile or git repo to pull from, but I wasn't completely sure which part of Rubygame this would fit into.

Statistics: Posted by tyler — Sat Jul 24, 2010 12:37 am


]]>