Sorgelig wrote:There is a big problem came with frame buffer implementation and use TTY.
TTY always listen and executes the keyboard input. This is why my linux originally was headless.
Now i have to deal with TTY (virtual terminal) and find the way to block the keyboard when it's not visible to user.
So far i cannot find explicit way to block the keyboard on TTY. There are some other awkward ways like EVIOCGRAB which doesn't work reliably and through loadkeys by re-defining the keys to NULL which is slow to setup.
So i have to find the way to turn off/on keyboard for TTY before will add it to MiSTer.
So, i need help from community.
I tried this code
https://stackoverflow.com/a/7672324 in a vmware virtual machine and it seems to work.
From SSH I got exclusive access to /dev/input/event0 (AT Translated Set 2 keyboard) and when I try to type something into the VMWare Player main window I get nothing there, instead I get the keycode in the SSH window.
[EDIT]
My bad, you already found the EVIOCGRAB solution, excuse me...
[EDIT2]
What did you find unreliable in the EVIOCGRAB solution? I tested it only with the VM and it seems to work, but I didn't test MiSTer...
[EDIT3]
Very stupid question... do we need agetty always running and attacched to TTY?
Can it be launched and killed just when we need a console directly by main MiSTer?
[EDIT4]
Maybe the [EDIT3] could be achieved through the use of different runlevels, so we could have a runlevel without agetty and one with agetty connected to TTY and main MiSTer could swap runlevel when we need a console.
P.S.: sorry for the many edits.
Regards.
Locutus73