Kernel: Implement unified input files for device hot-plugging support
/dev/keyboard and /dev/mouse can be read for events from any attached keyboard or mouse respectively. This makes device hot-plugging support pretty much automatic for TTY, GUI, and whatever takes input.
This commit is contained in:
@@ -158,11 +158,11 @@ int main()
|
||||
MUST(LibInput::KeyboardLayout::initialize());
|
||||
MUST(LibInput::KeyboardLayout::get().load_from_file("/usr/share/keymaps/us.keymap"_sv));
|
||||
|
||||
int keyboard_fd = open("/dev/keyboard0", O_RDONLY);
|
||||
int keyboard_fd = open("/dev/keyboard", O_RDONLY);
|
||||
if (keyboard_fd == -1)
|
||||
perror("open");
|
||||
|
||||
int mouse_fd = open("/dev/mouse0", O_RDONLY);
|
||||
int mouse_fd = open("/dev/mouse", O_RDONLY);
|
||||
if (mouse_fd == -1)
|
||||
perror("open");
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ void cleanup()
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
const char* fb_path = "/dev/fb0";
|
||||
const char* mouse_path = "/dev/mouse0";
|
||||
const char* mouse_path = "/dev/mouse";
|
||||
|
||||
if (argc == 1)
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user