Coder Social home page Coder Social logo

Comments (6)

sigmaSd avatar sigmaSd commented on July 24, 2024 1

thanks as well for taking the time to contribute!
Its not very clear to me as well,
maybe one way to solve this is to have a mini event loop like

let mut stdin = TerminalInput::new().read_sync();
let awnser = String::new();
loop {
    write(question);
    if let Some(key_event) = stdin.next() {    
        match key_event {
            InputEvent::Keyboard(KeyEvent::Char(c)) => {
                answer.push(c);
                write(c);
            }
            InputEvent::Keyboard(KeyEvent::Enter) => match answer {
                y | yes => quit,
                n => return,
                _ => continue,
            },
        }
    }
}

from irust.

jadijadi avatar jadijadi commented on July 24, 2024 1

Dear @sigmaSd , I've sent a PR for this, please feel free to comment or ask for any changes.

from irust.

jadijadi avatar jadijadi commented on July 24, 2024

Hi @sigmaSd , May I work on this?

from irust.

sigmaSd avatar sigmaSd commented on July 24, 2024

Hi @jadijadi ! Would be great, feel free to ask any question needed

from irust.

jadijadi avatar jadijadi commented on July 24, 2024

Dear @sigmaSd , thanks for the opportunity. Very cool project. Thumbs up!
Checking the code, I can say that I have to insert my code into events.rs, at pub fn handle_ctrl_d. I will use your write_newline and write but I did not figured out how I should read the keyboard input from the user. Should I user your buffer? Can you please give me a hint.

from irust.

sigmaSd avatar sigmaSd commented on July 24, 2024

fixed by #57

from irust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.