Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Leertaste & co. als hotkey (https://www.delphipraxis.net/25064-leertaste-co-als-hotkey.html)

Neuni 30. Jun 2004 15:58


Leertaste & co. als hotkey
 
Hi,
wie kann ich z.B. die Leertaste oder die back-taste als hotkey benutzen? (vielleicht sogar in nem THotKey)

shmia 30. Jun 2004 16:17

Re: Leertaste & co. als hotkey
 
Zitat:

Zitat von Neuni
wie kann ich z.B. die Leertaste oder die back-taste als hotkey benutzen? (vielleicht sogar in nem THotKey)

Ja. Nimm du eine ActionList, füge eine neue Action hinzu und ändere die Eigenschaft ShortCut nach Alt+Leertaste.
Man kann diesen Wert nicht im Objektinspektor auswählen, sondern muss ihn eintippen (zumindest bei D5).
Wahrscheinlich wollte Borland verhindern, dass man allzublöde Kombinationen als Shortcut verwendet.
In Unit Consts.pas befinden sich die speziellen Tasten:
Code:
  SmkcBkSp = 'Rück';
  SmkcTab = 'Tab';
  SmkcEsc = 'Esc';
  SmkcEnter = 'Enter';
  SmkcSpace = 'Leertaste';
  SmkcPgUp = 'BildAuf';
  SmkcPgDn = 'BildAb';
  SmkcEnd = 'Ende';
  SmkcHome = 'Pos1';
  SmkcLeft = 'Left';
  SmkcUp = 'Nach oben';
  SmkcRight = 'Rechts';
  SmkcDown = 'Nach unten';
  SmkcIns = 'Einfg';
  SmkcDel = 'Entf';
  SmkcShift = 'Umsch+';
  SmkcCtrl = 'Strg+';
  SmkcAlt = 'Alt+';

Neuni 30. Jun 2004 16:40

Re: Leertaste & co. als hotkey
 
so?
Code:
hotkey27.HotKey := 'SmkcSpace';
oder wie? wie ist das denn mit dem umwandeln? strtohotkey, oder wie geht das?

shmia 30. Jun 2004 16:52

Re: Leertaste & co. als hotkey
 
Delphi-Quellcode:
// ungetestet, aber logisch ;-)
// uses Consts wird benötigt
hotkey27.HotKey := TextToShortCut(SmkcAlt+SmkcSpace);
// oder besser so (TextToShortCut ist langsam)
hotkey27.HotKey := ShortCut(VK_Space, [ssAlt]);

Neuni 30. Jun 2004 17:13

Re: Leertaste & co. als hotkey
 
nur gibt es texttoshortcut nicht... :gruebel:

strtoshortcut auch nicht und ShortCut() wird auch nicht akzeptiert :(

Neuni 30. Jun 2004 17:17

Re: Leertaste & co. als hotkey
 
Ich habs...hab einfach VK_space genommen...danke


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:28 Uhr.

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