Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi THotKey - rechte Maustaste als Hotkey setzen (https://www.delphipraxis.net/123353-thotkey-rechte-maustaste-als-hotkey-setzen.html)

The Riddler 31. Okt 2008 09:29


THotKey - rechte Maustaste als Hotkey setzen
 
Entweder bin ich blind oder blöd, aber wie kann man bitte die rechte Maustaste als Hotkey in einer THotKey-Komponente setzen? Wenn der User die rechte Maustaste drückt, soll was passieren. In der Auswahl gibt es keine Möglichkeit dazu. :?

sirius 31. Okt 2008 09:34

Re: THotKey - rechte Maustaste als Hotkey setzen
 
Bist du dir sicher, dass vom System die rechte Maustaste generell als Hotkey vorgesehen ist?

The Riddler 31. Okt 2008 09:35

Re: THotKey - rechte Maustaste als Hotkey setzen
 
Ich hab keine Ahnung. :mrgreen:

Wäre wünschenswert wenn ich die Maustaste(n) trotzdem als Hotkey benutzen könnte. :-(

sirius 31. Okt 2008 09:38

Re: THotKey - rechte Maustaste als Hotkey setzen
 
Zitat:

Zitat von The Riddler
Ich hab keine Ahnung. :mrgreen:

Und sowas darf sich vor einen Rechner setzen. 8) *tztztz*

Zitat:

Wäre wünschenswert wenn ich die Maustaste(n) trotzdem als Hotkey benutzen könnte. :-(
Da würde ich ja mal auf einen globalen Mousehook tippen.
(Edit: Außer du findest noch die rechte Maustaste als Hotkey)

DeddyH 31. Okt 2008 09:50

Re: THotKey - rechte Maustaste als Hotkey setzen
 
RegisterHotKey erwartet doch einen virtuellen Keycode oder? Da könnte man ja VK_RBUTTON übergeben. Hab ich allerdings noch nie versucht, da mich ein solcher Hotkey vermutlich ziemlich nerven würde :lol:

The Riddler 31. Okt 2008 10:57

Re: THotKey - rechte Maustaste als Hotkey setzen
 
Hi Deddy, leider klappt das nicht mit der Maustaste.

Delphi-Quellcode:
if cbrightmousebtn.Checked = true then ShortCutToHotKey(VK_RBUTTON, Key, Modifiers) else ShortCutToHotKey(HotKey2.HotKey, Key, Modifiers);
if cbrightmousebtn.Checked = true then Hotkey_id2 := GlobalAddAtom('VK_RBUTTON') else Hotkey_id2 := GlobalAddAtom('MyHotKey_2');
RegisterHotKey(Handle, Hotkey_id2, Modifiers, Key);

procedure ShortCutToHotKey(HotKey: TShortCut; var Key : Word; var Modifiers: Uint);
var
  Shift: TShiftState;
begin
  ShortCutToKey(HotKey, Key, Shift);
  Modifiers := 0;
  if (ssShift in Shift) then
  Modifiers := Modifiers or MOD_SHIFT;
  if (ssAlt in Shift) then
  Modifiers := Modifiers or MOD_ALT;
  if (ssCtrl in Shift) then
  Modifiers := Modifiers or MOD_CONTROL;
end;
Ich nehme das ich um einen Mouse-Hook nicht drumrum kommen werde, oder? :-(

DeddyH 31. Okt 2008 10:59

Re: THotKey - rechte Maustaste als Hotkey setzen
 
Wenn das so nicht klappt, fällt mir spontan auch keine andere Möglichkeit ein. :(


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:11 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz