Форум: "Основная";
Текущий архив: 2002.11.04;
Скачать: [xml.tar.bz2];
ВнизСобытия мыши Найти похожие ветки
← →
Orc (2002-10-23 13:11) [0]Уважаемые! Как распознать левую и правую кнопку мыши (для 5-кнопочной мыши). Я перехватил коды, но они одинаковые для обоих кнопок ($020C - UP; $020B - DOWN). В Messages.pas я их вообще не нашел...
← →
Smithson (2002-10-23 13:21) [1]для [b]сколько[/b] кнопочной мыши?!!!
← →
Orc (2002-10-23 13:24) [2]5 кнопок с учетом MouseWheel ?!
← →
Андрей Прокофьев (2002-10-23 13:32) [3]Не очень понял, о чем Вы:
Начинаю угадывать :)
TForm.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
WM_RBUTTONDOWN, WM_LBUTTONDOWN ...
Сколько правильных ответов?
← →
Игорь Шевченко (2002-10-23 13:32) [4]Обрабатывать сообщения WM_XBUTTONDOWN, WM_XBUTTONUP. в wParam там номер кнопки мыши. (Только в XP, кстати).
Для колеса - WM_MOUSEWHEEL
← →
Игорь Шевченко (2002-10-23 13:34) [5]Андрей Прокофьев © (23.10.02 13:32)
Для поддержки мыши с более чем 3-мя кнопками введены новые сообщения: WM_XBUTTONxxxx
← →
Orc (2002-10-23 13:56) [6]Не совсем понял.....
Я получаю мышиное прерывание через
CallNextHookEx(HMouseHook,nCode,WP,LP);
где WP допустим $020B т.е. событие - кнопка (левая или правая (но естественно не тревиальные, события которых объявлены в TForm (или TControl - в общем виде))) отпущена. так как их различить если прерывания одинаковые?
А WM_XBUTTONUP (WM_XBUTTONDOWN) я не нашел в объялениях...но даже если найду я и так знаю из коды: ($020C - UP; $020B - DOWN). Пожалуйста поподробней для делитанта...
← →
Игорь Шевченко (2002-10-23 14:27) [7]WParam там такой есть.
← →
Андрей Прокофьев (2002-10-23 14:33) [8]2 Игорь Шевченко © (23.10.02 13:34)
Спасибо.
← →
Orc (2002-10-23 16:08) [9]Ребята - слушаю Вас и чувствую себя полным идиотом.
Может еще раз?
1. вызывая CallNextHookEx(HMouseHook,nCode,WP,LP); - получаю в том числе WP: wParam; // message identifier
2. WP = $020С (Собитие DOWN) как для левой кнопки, так и для правой. Аналогично с событием UP (когда отпускание обеих кнопок возвращает WP = $020B).
3. В каком конкретно модуле описаны константы WM_XBUTTONDOWN, WM_XBUTTONUP? Я не могу их найти, хотя и не уверен что это мне поможет.........!!!!!!!!!!!!!!!!!!!!!!!!
← →
Игорь Шевченко (2002-10-23 16:19) [10]The WM_XBUTTONDOWN message is posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Syntax
WM_XBUTTONDOWN
WPARAM wParam
LPARAM lParam;
Parameters
wParam
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values. Value Meaning
MK_CONTROL The CTRL key is down.
MK_LBUTTON The left mouse button is down.
MK_MBUTTON The middle mouse button is down.
MK_RBUTTON The right mouse button is down.
MK_SHIFT The SHIFT key is down.
MK_XBUTTON1 The first X button is down.
MK_XBUTTON2 The second X button is down.
The high-order word indicates which button was double-clicked. It can be one of the following values. Value Meaning
XBUTTON1 The first X button was double-clicked.
XBUTTON2 The second X button was double-clicked.
lParam
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return Value
If an application processes this message, it should return TRUE. For more information about processing the return value, see the Remarks section.
Remarks
Use the following code to get the information in the wParam parameter:
fwKeys = GET_KEYSTATE_WPARAM (wParam);
fwButton = GET_XBUTTON_WPARAM (wParam);
Use the following code to obtain the horizontal and vertical position:
xPos = GET_X_LPARAM(lParam);
yPos = GET_Y_LPARAM(lParam);
You can also use the MAKEPOINTS macro to convert the lParam parameter to a POINTS structure.
Unlike the WM_LBUTTONDOWN, WM_MBUTTONDOWN, and WM_RBUTTONDOWN messages, an application should return TRUE from this message if it processes it. Doing so will allow software that simulates this message on Microsoft® Windows® systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Notification Requirements
Minimum DLL Version None
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Included in Windows Millenium, Windows 2000
See Also
Mouse Input Overview, GET_KEYSTATE_WPARAM, GET_X_LPARAM, GET_XBUTTON_WPARAM, GET_Y_LPARAM, GetCapture, SetCapture, MAKEPOINTS, POINTS, WM_XBUTTONDBLCLK, WM_XBUTTONUP
← →
Orc (2002-10-23 16:33) [11]Игорь Шевченко © - ОГРОМНОЕ СПАСИБО !!!!!!!!!!!
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.11.04;
Скачать: [xml.tar.bz2];
Память: 0.47 MB
Время: 0.012 c