protected void doLockKeys() {

		if (!Options.useLockingKeyState)
			return;
		if (Constants.OS == Constants.LINUX)
			return; // broken for linux
		if (Constants.OS == Constants.MAC)
			return; // unsupported operation for mac
		logger.debug("doLockKeys");

		try {
			Toolkit tk = Toolkit.getDefaultToolkit();
			if (tk.getLockingKeyState(KeyEvent.VK_CAPS_LOCK) != capsLockOn) {
				capsLockOn = !capsLockOn;
				logger.debug("CAPS LOCK toggle");
				sendScancode(getTime(), RDP_KEYPRESS, 0x3a);
				sendScancode(getTime(), RDP_KEYRELEASE, 0x3a);

			}
			if (tk.getLockingKeyState(KeyEvent.VK_NUM_LOCK) != numLockOn) {
				numLockOn = !numLockOn;
				logger.debug("NUM LOCK toggle");
				sendScancode(getTime(), RDP_KEYPRESS, 0x45);
				sendScancode(getTime(), RDP_KEYRELEASE, 0x45);

			}
			if (tk.getLockingKeyState(KeyEvent.VK_SCROLL_LOCK) != scrollLockOn) {
				scrollLockOn = !scrollLockOn;
				logger.debug("SCROLL LOCK toggle");
				sendScancode(getTime(), RDP_KEYPRESS, 0x46);
				sendScancode(getTime(), RDP_KEYRELEASE, 0x46);
			}
		} catch (Exception e) {
			Options.useLockingKeyState = false;
		}
	}