About whether System.setIn (), can seize keyboard control.

  1. when I saw this, I wondered blindly whether I would use this sentence to invalidate keyboard input. All the input content is from a file set by myself.
  2. it"s OK to write a simple java file, but what if it"s an application?
  3. Can
  4. get keyboard control wherever jvm is running?
Sep.11,2021

System.setIn just changes the standard input device of the current application. You can use the following example:

public class NewSystemIn {

    public static void main(String ...args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            System.out.println(scanner.nextLine());
        }
    }
}

when Program 1 outputs the contents of a custom input device, Program 2 still behaves normally (can read keyboard input).

Keyboard won't be implemented so easily.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5df8b-45788.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5df8b-45788.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?