Is there any daemon/tool which will trigger some signal/event when usb keyboard is plugged and unplugged from pc ? I need to know in my program when usb keyboard is plugged
udevadm monitor (the udev administration binary) or udev_monitor (in libudev).
Alternately, if you're running in X11 with input hotplugging, you can listen for the XI extension event DevicePresenceNotify.
DevicePresenceNotify