# Highline

**URL:** <https://www.ruby-forum.com/t/highline/196244>\
**Category:** Ruby\
**Created:** [October 9, 2010, 8:19pm UTC](https://www.ruby-forum.com/t/highline/196244 "2010-10-09T20:19:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyproject](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@rubyproject](https://www.ruby-forum.com/u/rubyproject)\
**Post date:** [October 9, 2010, 8:19pm UTC](https://www.ruby-forum.com/t/highline/196244/1 "2010-10-09T20:19:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rubyproject](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e274bd/32.png) [@rubyproject](https://www.ruby-forum.com/u/rubyproject)\
**Post date:** [October 10, 2010, 1:36am UTC](https://www.ruby-forum.com/t/highline/196244/2 "2010-10-10T01:36:35Z")

</div>

On Oct 9, 2010, at 1:19 PM, Ruby P. 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 G. II
