Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Highline

Reply
Thread Tools

Highline

 
 
Ruby Program
Guest
Posts: n/a
 
      10-09-2010
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\respec t_x.wav')
else
print "Now exiting"
end
end
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
James Edward Gray II
Guest
Posts: n/a
 
      10-09-2010
On Oct 9, 2010, at 1:19 PM, Ruby Program wrote:

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] HighLine 0.2.0 James Edward Gray II Ruby 2 04-29-2005 08:02 PM
[SOLUTION] HighLine (#29) Ryan Leavengood Ruby 6 04-29-2005 02:36 PM
[SUMMARY] HighLine (#29) Ruby Quiz Ruby 0 04-28-2005 12:26 PM
[SOLUTION] Highline (#29) mark sparshatt Ruby 0 04-24-2005 05:04 PM
[QUIZ] HighLine (#29) Ruby Quiz Ruby 8 04-22-2005 03:47 PM



Advertisments