ruby keyboard commando switch off

S

Sir h Dauven

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-forum.com/attachment/1893/little_problem_game_1.jpg
 
H

H. Dauven

I heard it was possible but I didn't find anything yet, maybe someone
would know?
 
H

H. Dauven

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
 
J

John Joyce

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top