Insertion removal keyboard
From AlwaysInnovating
The halevt daemon, which is launched by "/usr/bin/ai/autostart/start.sh" during X startup, watches for USB insertion and removal. Ivman has been replaced by halevt since 2009-09.c.
If the AI keyboard is detected, according to "/etc/halevt/halevt.xml", it executes "/usr/bin/ai/halevt/keyboard.sh -r" (removal) or "/usr/bin/ai/halevt/keyboard.sh -i" (insertion).
These scripts create or delete /tmp/ai.tablet, which is the main indicator for the OS to know if it's in tablet mode or not. In tablet mode, xfwm4 behaves differently with only one window at a time, and the screen keyboard is activated. The script also sends a signal to the ai-daemon to update the rotation status of the display with "sudo /usr/bin/killall -USR1 ai_daemon".
