Keyboard Stuff

[SIZE=4][FONT=Comic Sans MS][COLOR=#680aac]I’m wondering if anyone has any ideas on how to write a program that detects what keyboard you have plugged in, and automatically changes the active keyboard layout. I.E. I have a Dvorak keyboard, and a Qwerty keyboard, and I want to automate the keyboard layout switching process whenever I switch the plugs (multiple people use my computer). If anyone has any ideas, please feel free to share.[/COLOR][/FONT][/SIZE]