[?] What do you want to do?
> Order a pizza
Make a reservation
--------
Ask opening hours
Talk to the receptionistOk, so this is something I've wanted to do for a couple years with my use of JLine in CommandBox CLI, but with the troubles I had just making a simple progress bar, I had avoided attempting this. Now that I'm on JLine3, I wanted to check and see what's built in (if anything) or any guides, examples, or pointers on what classes to use.See this npm library for examples of what I'm talking about:I want to interact with users via the command with radio button or checkbox-style inputs that redraw in place to allow the user to navigate options with arrow keys and use the spacebar/enter or something similar to select options prior to submitting them. This would be great for command line installers, wizards, or for general task scripting. The trick has always been how I redraw the screen to update as they manipulate the "form" controls.[?] What do you want to do? > Order a pizza Make a reservation -------- Ask opening hours Talk to the receptionistIn Jline2, I couldn't even get a consistent way to detect something as simple as up/down/left/right arrows!I was excited to see that the completor stuff in JLine3 is very fancy and already incorporates many of the same behaviors that I've been wanting to do for so long.Any input is appreciated on where to attack this from:
- How do I consistently detect control keys like arrow keys?
- How do I redraw several lines of the terminal over and over and potentially also keep the cursor on a line above?
- Is there anything built in to JLine at this point for larger interactions like this? (outside of the tab-completion stuff)
--Thanks!
~Brad
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
As I explained in the jline2 issue, JLine does not read key presses.
The Display class is what you're looking for.
As I explained in the jline2 issue, JLine does not read key presses.Ahh, yes - this is the long conversation we had in the JLine2 ticket over again. We seemed to have some philosophical differences and I was hoping you had softened your stance. I felt back then, and still do today, that JLine would benefit immensely from an out-of-the box abstraction that "just works" on any OS to allow users of the JLine library to capture individual keystrokes/bindings-- even if it takes more than one byte being read from the input stream behind the scenes. This just feels like basic keyboard interactions.
KeyMap<String> keys = new KeyMap<>();
keys.setUnicode("self-insert");
keys.setNomatch("self-insert");
EnumSet.of(Capability.key_up, Capability.key_down, Capability.key_left, Capability.key_right).forEach(c -> keys.bind(c.name(), KeyMap.key(terminal, c)));
Is the code sample you provided in the Jline2 ticket still the only way for me to do this? I'm still unclear on whether that was code that would only work on Windows, or if it would have worked on all operating systems. I do see that the BindingReader class looks to be new in JLine3 so I'm guessing that Jline2 version is outdated now.Is there anyway to just get JLine to use the internal Keymap it's already using? Like with the Jline2 examples, I still don't understand why I need to create an key map that handles the codes for things like up arrow, when Jline already does this seamlessly in all other areas (for instance, up arrow works on any OS for displaying the history). It seems JLine already has a keymap constructed that it's using internally. Can't I just have it use that one?
How do I capture Ctrl-C when the bindingReader.readBinding() method is running? It seems the signal handlers aren't kicking in and if I try to bind ctrl('C') it doesn't fire.
The BindingReader has nothing to do with signals.
Did you manage to catch any signal at all ?
The BindingReader has nothing to do with signals.Sorry for the confusion, I didn't intend to imply that it did. I was simply saying that no signals seemed to fire and no key bindings were reported. It was a list of two items that failed to do anything.Did you manage to catch any signal at all ?Not that I know of, but then again I haven't put in any code to try and do so. Do I need to? I'm used to the Ctrl-C stuff just working automatically when I'm calling readLine(). Do the signals behave differently when calling readBinding()?
Thanks!
~Brad
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users...@googlegroups.com.
Thanks!
~Brad
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jline-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jline-users+unsubscribe@googlegroups.com.