[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby keyboard commando switch off

Sir h Dauven

5/10/2008 3:52:00 PM

I'm not really a master with ruby, so I would nicely want to ask if
someone would know how to disable some keyboard keys.

My friend and me are making a little game and in the engine we work
there is a bug that if you press CTRL you can go in and out every object
where you normally can't walk.

so I would like to know if someone knew the ruby code to disable the
CTRL button?

Thank you! ^^

P.S.: the engine only works with ruby.

Attachments:
http://www.ruby-...attachment/1893/little_problem_...

--
Posted via http://www.ruby-....

3 Answers

Sir h Dauven

5/10/2008 5:07:00 PM

0

I heard it was possible but I didn't find anything yet, maybe someone
would know?
--
Posted via http://www.ruby-....

Sir h Dauven

5/10/2008 8:07:00 PM

0

Ok I am now this far

if Input.press?(Input::CTRL)
return
end

but I want to disable the key.

Maybe someone has a hint?

Thanks!

H. Dauven
--
Posted via http://www.ruby-....

John Joyce

5/11/2008 2:31:00 PM

0

H. D.
You should check out some of the game libraries for Ruby.
Gosu
RubySDL
etc...

The keyboard thing is going to be largely platform dependent.
Many times, game libraries try to be crossplatform too.

At the very worst, you may need to create a ruby extension.
The Allegro game library, done in C, has a nicely abstracted set of
keyboard controls...