Seite 1 von 1
Shortcut erstellen - wie kann ich HotKey verwenden
Verfasst: 23.08.2007 21:51
von funk.munich
Hallo zusammen,
im Code Archiv habe ich ein Bsp. zum Erstellen einer Verknüpfung
gefunden.
http://www.purearea.net/pb/CodeArchiv/W ... ellLink.pb
Ich würde gerne einen HotKey mit übergeben z.B. STRG + ALT + x.
In dem Bsp. sind folgende flags mit aufgeführt:
HOTKEYF_ALT = ALT key
HOTKEYF_CONTROL = CTRL key
HOTKEYF_EXT = Extended key
HOTKEYF_SHIFT
Wie kann ich diese nun nutzen? Ist egal was ich mit den flags ausprobiere, es funktioniert einfach nicht.
Nur, wenn ich ohne die flags, also nur den ASCII Wert für das 'x' = 120
übergebe funxt es.
Hat hierzu jemand eine Idee? Ich habe zwar einige Forums Einträge zu
Verknüpfungen gefunden, aber niemand hat HotKeys genutzt.
Danke im vorraus,
Daniel
Verfasst: 23.08.2007 22:03
von ts-soft
Bevor Du HotKeys setzt, mußte ja erstmal prüfen welche noch frei
sind, weil Doppelbelegung funzt nicht. Hotkey per Programm zu
setzen halte ich nicht für sehr sinnvoll, hab mich bisher über
solche Sachen nur geärgert (Editor bei MASM macht sowas, hat
dafür einen meiner Hotkeys zerstört)
Ansonsten, haste es mit einer | Verknüpfung probiert?
Verfasst: 23.08.2007 22:04
von Kaeru Gaman
hab die konstanten mal ausgeben lassen, und den wichtigen absatz mit zitiert:
Code: Alles auswählen
; Hotkey:
; The virtual key code is in the low-order byte,
; and the modifier flags are in the high-order byte.
; The modifier flags can be a combination of the following values:
;
Debug #HOTKEYF_ALT ; ALT key
Debug #HOTKEYF_CONTROL ; CTRL key
Debug #HOTKEYF_EXT ; Extended key
Debug #HOTKEYF_SHIFT ; SHIFT key
du musst die modifier mit bitwise-Or zusammensetzen, und mit bitshift ins hi-byte schieben.
probier also mal
Code: Alles auswählen
HotkeyValue = Asc("x") + (( #HOTKEYF_CONTROL | #HOTKEYF_ALT) << 8 )
PS:
und natürlich das bedenken, was ts dazu gesagt hat.
leute mögen keine programme, die rigoros Hotkeys setzen.
Verfasst: 24.08.2007 09:27
von funk.munich
Hi Ihr beiden,
danke erst einmal für eure Hilfe.
Da habt ihr recht und selber würde ich das auch nicht machen wollen.
Mir ging es jetzt nur darum zu verstehen, wie es funktioniert.
Eine Frage hätte ich da noch ... wofür nutzt ihr "... << 8" ?
Code: Alles auswählen
HotkeyValue = Asc("x") + (( #HOTKEYF_CONTROL | #HOTKEYF_ALT) << 8 )
Danke + Gruß,
Daniel
Verfasst: 24.08.2007 10:15
von Kaeru Gaman
Kaeru Gaman hat geschrieben: ; Hotkey:
; The virtual key code is in the low-order byte,
; and the modifier flags are in the high-order byte.
; The modifier flags can be a combination of the following values:
du musst die modifier mit bitwise-Or zusammensetzen, und mit bitshift ins hi-byte schieben.
probier also mal
HotkeyValue = Asc("x") + (( #HOTKEYF_CONTROL | #HOTKEYF_ALT) << 8 )
Help -> Variablen, Typen und Operatoren
Verfasst: 24.08.2007 13:02
von funk.munich
Hi Kaeru,
wer lesen kann ist klar im Vorteil und wenn man dann noch weiß wo alles steht.
Vielen Dank,
Daniel
Arithmetic shift left. Shifts each bit in the value of the expression on the LHS left by the number of places given by the value of the expression on the RHS. Additionally, when the result of this operator is not used and the LHS contains a variable, that variable will have its value shifted. It probably helps if you understand binary numbers when you use this operator, although you can use it as if each position you shift by is multiplying by an extra factor of 2.
Example:
a=%1011 << 1 ; The value of a will be %10110. %1011=11, %10110=22
b=%111 << 4 ; The value of b will be %1110000. %111=7, %1110000=208
c.l=$8000000 << 1 ; The value of c will be 0. Bits that are shifted off the left edge of the result are lost.