-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
Mouse on linux terminal without X11 #1074
Comments
@igrag
Somewhere before your There are also methods for enabling paste and other possible features you may be looking for. While you could do what you provided as an example and manually create events for the mouse and other such, there are actually methods with gdamore/tcell which is the underlying terminal terminfo backend which you can use (albeit with some added complexity for initializing along with tview) that would make handling all events including mouse, keyboard, paste, resize and others much easier than the possibile implementation you gave as an example. Not that they are even necessary if properly using thiew and letting it handle them. Look through the demo, wiki, and API reference. You can see examples of all the things that are available and how to do them. |
First of all thank you for your reply. What I have done and it seems that tview started to respond to mouse is this:
mouseEvent := tcell.NewEventMouse(x, y, tcell.ButtonPrimary, tcell.ModNone)
and tview responded, for example a button was pressed. Maybe it is usefull to add this kind of funtionallity in the future for cases like this. Best Regards, |
Understood, can you not utilize, |
Yes, I tried but no response from tview. |
@igrag do you get any response at a regular shell prompt? Does the cursor move at least when sitting at your shell's prompt? Sometimes you have to ensure the service is running before logging in or your virtual console daemon starts (getty/agetty) |
Yes, I have response from the regular prompt with gpm. I can see the cursor moving at various locations. What I also did is to set the SetMouseCapture callback to have some feedback from mouse, but the callback never fired from gpm. This callback works fine in a typical ubuntu desktop console. |
What is your $TERM environment var set to? If you do an |
@igrag You could create your own Then you call |
Hello.
we are trying to develop a simple console gui on a system that doesn't have X11. Everhtning works excpet the mouse events. Logical because the terminal does not support mouse. But the mouse is there and we can see it in /dev/input and also it works with evtest.
Is it possible to inject MouseEvents in tview like this?
mouseEvent := tcell.NewEventMouse(x+offset, y, tcell.ButtonPrimary, tcell.ModNone)
If yes how could we send it globally to the app to the mainloop for dispatching?
Of course we will first start a goroutine watching the /dev/input/mice device.
Thank you.
Best Regards,
Giannis
The text was updated successfully, but these errors were encountered: