IJCuper
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Увы, ShiftState не может обрабатывать все клавиши. Вот фрагмент из документации: Цитата: Indicates the state of the Alt, Ctrl, or Shift key, mouse buttons, or touch devices. The TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, or Shift key, the state of the mouse buttons or of an attached touch device, when the event occurs. It is a set of flags that indicates the following states: Value Meaning ssShift -The Shift key is held down. ssAlt - The Alt key is held down. ssCtrl - The Ctrl key is held down. ssLeft - The left mouse button is held down. ssRight - The right mouse button is held down. ssMiddle - The wheel mouse button is held down. ssDouble - The mouse button was double-clicked. ssTouch - The user is holding a finger on the touch surface. ssPen - The pen is touching the surface of a tablet. | Можно попробовать обратиться к функции GetKeyBoardState напрямую. Что-то типа Код: procedure TForm2.CheckBox1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var KBDState: TKeyboardState; begin GetKeyBoardState(KBDState); if ((KBDState[VK_CAPITAL] And 128) <> 0) then showmessage('Удерживается нажатой клавиша CapsLock'); if ((KBDState[vkTilde] And 128) <> 0) then showmessage('Удерживается нажатой клавиша Тильда'); end; | (Для обработки константы vkTilde нужно в строку Uses в начале модуля дописать UITypes, либо заменить vkTilde на ее код = 192) А как уж скомбинировать опрос клавиш и проверку движения мыши над конкретным объектом - надо смотреть по логике программы. | Всего записей: 669 | Зарегистр. 07-07-2004 | Отправлено: 01:12 17-02-2014 | Исправлено: IJCuper, 13:52 17-02-2014 |
|