One way to lock a Windows computer from your keyboard is by pressing Ctrl + Alt + Del and then selecting the "Lock" option.
You can connect a wireless keyboard to a Mac or PC using Bluetooth, as long as the keyboard is charged and in pairing mode.