Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ REQUEST ] more events akin to JS events #219

Open
octoshrimpy opened this issue Nov 23, 2022 · 1 comment
Open

[ REQUEST ] more events akin to JS events #219

octoshrimpy opened this issue Nov 23, 2022 · 1 comment

Comments

@octoshrimpy
Copy link

usecase: modeless term editor w/ optional mouse input

source: https://github.com/octoshrimpy/brain-cli/blob/master/null

It would be nice to have more events on form input elements, similar to the js events currently present in the browser. As it stands, the code can differentiate between focus and blurred to set appropriate styling. I'd love to listen to the onBlur event to enable/disable the cursor for when the user clicks outside the textbox.

@cronvel
Copy link
Owner

cronvel commented Nov 24, 2022

@octoshrimpy Hmm, I think the blur event already exists for most (if not all) the widget. It's part of the Element base class, so all widget got it.

If you are building you own text editor, you may want to have a look into ne (aka Neon), the editor I'm developing. Be sure to install it from npm OR to check out a release tag because the last time I worked on it, I left it in an unclean state. It supports Javascript syntax hilighting, and it's a rather good demo of what Terminal Kit can do. The hilighting code is not yet optimized, so it can be a bit slow on 2000+ files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants