For your list_keyboard_devices
you will need to change devices = wmi.InstancesOf("Win32_Keyboards")
to devices = wmi.InstancesOf("Win32_Keyboard")
. Note that you have use signular form Win32_Keyboard
. This should give you a list of keyboards.