Highline

R

Ruby Program

Was using highline for a program I am making for learning/fun. I got it
working perfectly but I have made it hit a limit which I don't know how
to get past. I want it to be able to use get_charter outside the
console.

Is this possible with highline or is there another library I can use
that will have this ability?


require 'rubygems'
require 'highline/import'
require "highline/system_extensions"
require 'win32/sound'
include Win32
include HighLine::SystemExtensions

char = 0;
while char.chr != "z"
char = get_character
if char.chr == "a"
Sound.play('C:\Users\rubiest\Desktop\Sounds\ask_mr_hat.wav')
elsif char.chr == "s"
Sound.play('C:\Users\rubiest\Desktop\Sounds\drugs_x.wav')
elsif char.chr == "d"
Sound.play('C:\Users\rubiest\Desktop\Sounds\screw-u_x.wav')
elsif char.chr == "f"
Sound.play('C:\Users\rubiest\Desktop\Sounds\respect_x.wav')
else
print "Now exiting"
end
end
 
J

James Edward Gray II

Was using highline for a program I am making for learning/fun. I got = it
working perfectly but I have made it hit a limit which I don't know = how
to get past. I want it to be able to use get_charter outside the
console.

HighLine is really focused towards console interactions, so it probably =
won't be of much help outside of that environment.

If you are wanting to read characters off of some IO-like interface for =
Ruby getc() may help. If you mean that you wish to capture keystrokes =
in a GUI environment, you'll need to look at a windowing toolkit.

I hope that helps.

James Edward Gray II=
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top