Highline

Discussion in 'Ruby' started by Ruby Program, Oct 9, 2010.

  1. Ruby Program

    Ruby Program Guest

    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
    --
    Posted via http://www.ruby-forum.com/.
     
    Ruby Program, Oct 9, 2010
    #1
    1. Advertising

  2. 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=
     
    James Edward Gray II, Oct 9, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ruby Quiz

    [QUIZ] HighLine (#29)

    Ruby Quiz, Apr 22, 2005, in forum: Ruby
    Replies:
    8
    Views:
    147
    James Edward Gray II
    Apr 22, 2005
  2. Ryan Leavengood

    [SOLUTION] HighLine (#29)

    Ryan Leavengood, Apr 24, 2005, in forum: Ruby
    Replies:
    6
    Views:
    122
    James Edward Gray II
    Apr 29, 2005
  3. mark sparshatt

    [SOLUTION] Highline (#29)

    mark sparshatt, Apr 24, 2005, in forum: Ruby
    Replies:
    0
    Views:
    134
    mark sparshatt
    Apr 24, 2005
  4. Ruby Quiz

    [SUMMARY] HighLine (#29)

    Ruby Quiz, Apr 28, 2005, in forum: Ruby
    Replies:
    0
    Views:
    157
    Ruby Quiz
    Apr 28, 2005
  5. James Edward Gray II

    [ANN] HighLine 0.2.0

    James Edward Gray II, Apr 29, 2005, in forum: Ruby
    Replies:
    2
    Views:
    108
    James Edward Gray II
    Apr 29, 2005
Loading...

Share This Page