Sie sind vermutlich noch nicht im Forum angemeldet - Klicken Sie hier um sich kostenlos anzumelden Impressum 
Sie können sich hier anmelden
Dieses Thema hat 29 Antworten
und wurde 542 mal aufgerufen
 Skripte und Zusatzprogramme
Seiten 1 | 2
monkey8 Offline



Beiträge: 315

23.04.2010 01:01
RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Below is an advanced script that holds down the Windows key, try it with Windows 7 e.g. "Windows key down" and then for example try commands like "press tab".
This will display all your applications currently running and if you continue with "press tab" it will move through the tasks.

' Script by Lindsay Adam 2010 www.pcbyvoice.com
' Declare keyboard events Windows API function
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
' declare virtual key constant for the Windows key
Const VK_LWIN = 91
Sub Main
' hold Windows key down
keybd_event(VK_LWIN,0,0,0)
End Sub

To release the Windows key e.g. "Windows key up" it is an identical script except you change the one line to:

keybd_event(VK_LWIN,0,2,0)

The third parameter (0 or 2) dictates whether the keyboard event is a key down command or a key up (release key) command. The principle used above can obviously be used to hold down any keys and the scripts can be adapted to display tasks from the taskbar directly etc.

Lindsay Adam

Marius Raabe Offline



Beiträge: 718

23.04.2010 07:41
#2 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Lindsay: Interesting input, thanks a lot!
Just one stupid question from a non-script-kid: What if the command browser returns a syntax error (undeterminated block statement) and highlights the Declare... Line and the following line - which it does in my case after copying your script into the advanced scripting window

Regards, Marius

Dragon NaturallySpeaking 11.5 Legal
Windows 7 Prof. 64-Bit, Office 2010, Jarte Plus
Philips SpeechMike II Pro Plus, SpeechMike III, SpeechMike Air, PDCC 2.8
Intel Core2 Quad Q9550, 2,83 GHz, 2x6MB L-2, 8 GB RAM

R.Wilke Offline



Beiträge: 6.334

23.04.2010 10:30
#3 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hallo Marius,

wenn das Skript wie unten aussieht, wird damit die Win-Taste runter gedrückt:





Mit gedrückter Win-Taste können dann weitere Tasten per Sprachbefehl gedrückt werden, z.B. "drück r", um den "Ausführen"-Dialog zu starten, oder Cursortasten. Wie Lindsay schon erklärt hat, muss die letzte Code-Zeile umgeschrieben werden, um analog einen Befehl wie "Win-Taste rauf" zu definieren.

Dass die Win-Taste und prinzipiell jede beliebige Taste mittels Zugriff über die Windows API und per Sprachbefehl angesteuert werden kann, ist übrigens Lindsay's Entdeckung. Er ist eben ein Programmierer.

Danke dafür an den Author!

Rüdiger

_______________________________________

Dragon Professional 16 auf Windows 10 Pro und Windows 11
SpeechMike Premium (LFH3500); Office 2019 Pro + Office 365 (monatliches Abo)
HP ZBook Fury 17 G8 - i7-11800H - 24 MB SmartCache - 32 GB RAM - 1 TB SSD

Marius Raabe Offline



Beiträge: 718

23.04.2010 13:36
#4 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

O.K., thanks a lot, both of you, I got it now!!!

Marius

Dragon NaturallySpeaking 11.5 Legal
Windows 7 Prof. 64-Bit, Office 2010, Jarte Plus
Philips SpeechMike II Pro Plus, SpeechMike III, SpeechMike Air, PDCC 2.8
Intel Core2 Quad Q9550, 2,83 GHz, 2x6MB L-2, 8 GB RAM

monkey8 Offline



Beiträge: 315

23.04.2010 14:53
#5 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Marius

Yes Rüdiger has showed how it should be displayed in the advance script dialogue. Once you have added this, and and called it e.g. window key down. Then try these voice commands for example:

press tab
press tab
... (this is just an example of scrolling through the tasks)

with Windows 7 the Windows key is now very useful, check the following link for other things you can do holding down the Windows key and pushing the Windows key and combinations. If you need further information on how to script windows key with combinations then let me know.

http://gizmodo.com/5139691/windows-7-tip...otkey-shortcuts

to release the Windows key just add a script with the line shown up above in the first post of this thread.

Lindsay

Marius Raabe Offline



Beiträge: 718

26.04.2010 09:58
#6 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Lindsay,

thanks a lot again. I truly like the new functions of the Win-Keys in Win 7, but, being dumb when it comes to coding, I used AutoHotkey to generate the necessary keystrokes and then DNS again to call the AutoHotkey-scripts. Your approach is, needless to say, far more elegant, but would have been totally out of reach for me had it not been for your kind knowledge-sharing (and Rüdigers's help).

Your invention even provides a spin-off solution for another problem of mine, namely, calling the NatSpeak-feature of "voice notations" in Word by voice command. As you will certainly know, you need to keep the Escape-Key pressed while dictating into a word window, which can by achieved by voice command like that:

Command name "begin voice notation" (in German: "Sprachkommentar beginnen")

' Big Thankyou to Lindsay Adam 2010 www.pcbyvoice.com
' Declare keyboard events Windows API function
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Sub Main
' hold Escape key down
keybd_event(27,0,0,0)
End Sub

By a corresponding command "end voice notation" you can do what it says


' Big Thankyou to Lindsay Adam 2010 www.pcbyvoice.com
' Declare keyboard events Windows API function
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
Sub Main
' release Escape key
keybd_event(27,0,2,0)
End Sub

The possibilities are endless...

Marius

Dragon NaturallySpeaking 11.5 Legal
Windows 7 Prof. 64-Bit, Office 2010, Jarte Plus
Philips SpeechMike II Pro Plus, SpeechMike III, SpeechMike Air, PDCC 2.8
Intel Core2 Quad Q9550, 2,83 GHz, 2x6MB L-2, 8 GB RAM

monkey8 Offline



Beiträge: 315

26.04.2010 11:46
#7 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hi Marius

Glad you have found the technique useful, like you say the possibilities are endless for holding down various keys. The other very useful one is holding down the control key.

Thanks for the feedback, Lindsay

Marius Raabe Offline



Beiträge: 718

26.04.2010 12:45
#8 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

... even I (vB-illiterate) was able to reckon how to integrate more keys into a single script so you can say a single voice command e.g. to snap-in the active window on the left half of the screen (using Windows 7, of course - whereas the more sophisticated scripts you provided in an earlier thread work independently from the Windows 7-snap-in-feature and offer a greater variety of positions) :


' Original Script by Lindsay Adam 2010 www.pcbyvoice.com , altered by MR, hope you don't mind
' Declare keyboard events Windows API function
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
' declare virtual key constant for the Windows key
Const VK_LWIN = 91
' Add-on by MR: declare constant for left arrow key
Const VK_LEFT = &H25
Sub Main
' hold Windows key down
keybd_event(VK_LWIN,0,0,0)
' Add-on: first press, then release left arrow key
keybd_event(VK_LEFT,0,0,0)
keybd_event(VK_LEFT,0,2,0)
' release Windows key
keybd_event(VK_LWIN,0,2,0)
End Sub

.... makes me feel like Jean-Luc Picard, although the computer still keeps me waiting for my Earl Grey

Marius

Dragon NaturallySpeaking 11.5 Legal
Windows 7 Prof. 64-Bit, Office 2010, Jarte Plus
Philips SpeechMike II Pro Plus, SpeechMike III, SpeechMike Air, PDCC 2.8
Intel Core2 Quad Q9550, 2,83 GHz, 2x6MB L-2, 8 GB RAM

JoeBu Offline




Beiträge: 213

30.12.2010 19:44
#9 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hello Lindsay,

Do you have an overview which number of the constant stands for which key?

Kind regards

Jörg

monkey8 Offline



Beiträge: 315

30.12.2010 19:56
#10 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Zitat von JoeBu
Hello Lindsay,

Do you have an overview which number of the constant stands for which key?

Kind regards

Jörg



http://msdn.microsoft.com/en-us/library/ms927178.aspx

The above link gives the hexadecimal values which you can convert to decimal or enter directly as hexadecimal e.g.

VK_F5 =116 (7 x 16) + 4
VK_F5 = &H74

Lindsay

Stecknadel Offline



Beiträge: 78

24.06.2011 16:59
#11 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hallo zusammen!
Bei mir funktioniert das runterdrücken von Tasten irgendwie nicht. Habe schon verschiedene Tasten ausprobiert, jedes Mal wird die Taste nur genau einmal gedrückt, aber nicht gehalten. Als Beispiel habe ich hier ein Skript eingefügt, das über Windows- Taste+d den Desktop anzeigen soll.(ich weiß, dafür gibt es auch einen Dragon-Befehl, aber das soll ja nur ein Beispiel sein.)

Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long
' declare virtual key constant for the Windows key
Const VK_LWIN = 91
Sub Main
' hold Windows key down
keybd_event(VK_LWIN,0,0,0)
SendKeys"d"
keybd_event(VK_LWIN,0,2,0)
End Sub


bei Ausführung dieses Skripts wird aber nicht der Desktop angezeigt, sondern lediglich das Startmenü. Die Windows-Taste wird also nur einmal kurz angedrückt und nicht gehalten. Was mache ich da falsch?die Tastendrück-Befehle sind nämlich echt praktisch, ich könnte die an so vielen Stellen brauchen, wenn sie funktionieren würden:-)
vielen Dank schon mal!

Marius Raabe Offline



Beiträge: 718

24.06.2011 18:11
#12 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Na, das führt ja zu einem heute schon anderweit diskutierten Thema!

Statt: SendKeys sollten Sie mal versuchen

SendSystemKeys "d"

Dann sollte es gehen (ob es auch mit SendDragonKeys geht, wäre zu probieren).

Gruß, Marius Raabe

Dragon NaturallySpeaking 11.5 Legal
Windows 7 Prof. 64-Bit, Office 2010, Jarte Plus
Philips SpeechMike II Pro Plus, SpeechMike III, SpeechMike Air, PDCC 2.8
Intel Core2 Quad Q9550, 2,83 GHz, 2x6MB L-2, 8 GB RAM

Stecknadel Offline



Beiträge: 78

24.06.2011 18:38
#13 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

vielen Dank für die Hilfe! Das werde ich am Montag in der Arbeit ausprobieren und dann berichten.

monkey8 Offline



Beiträge: 315

25.06.2011 00:19
#14 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hi Susanne

Marius has already answered the question and that should work. However you can achieve what you are trying to do just as easy with the following.

Sub Main
ClearDesktop
End Sub

have a nice weekend

Lindsay
www.pcbyvoice.com

Stecknadel Offline



Beiträge: 78

27.06.2011 16:15
#15 RE: Holding down the Windows key using advanced scripts Zitat · Antworten

Hallo zusammen!
Vielen Dank nochmal für eure Hilfe! Heute habe ich das in der Arbeit ausprobiert, aber leider ohne Erfolg. Sowohl SendSystemKeys, als auch SendDragonKeys hat nicht funktioniert:-(
Hier ist mein Beispielskript:
declare keyboard events Windows API function
Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long


Const VK_SHIFT = 16
Sub Main


diramt = ListVar1 ' this is the unit number of {arrow} movements
sndkeystr$ = "{Down}"
keybd_event(VK_SHIFT,0,0,0)
For i = 1 To diramt



SendDragonKeys "{Down}"


Next i ' press "{arrow}" key(s) "diramt" times
Wait 0.5
keybd_event(VK_SHIFT,0,2,0)


End Sub

das müsste doch eigentlich funktionieren, oder? Die Pfeiltasten werden nach unten gedrückt, das klappt soweit. Aber die Shift-Taste wird nicht gehalten.
Ich weiß, es gibt diesen Befehl auch bei Dragon, aber da funktioniert er nur für circa 20 Zeilen. Wenn ich zum Beispiel sage" 71 Zeilen nach unten markieren", markiert er mir nur immer circa 19 Zeilen. Drum wollte ich mir einen eigenen Befehl mit einer Variablen schreiben. Ich muss nämlich zurzeit ziemlich viel markieren und kopieren, und mit den Befehlen von Dragon klappt es nur sehr schlecht.
Wäre total nett, wenn mir jemand weiterhelfen könnte!

Seiten 1 | 2
Ähnliche Themen Antworten/Neu Letzter Beitrag⁄Zugriffe
15.3 funktioniert nicht mehr richtig, es stört andere Software, es verschluckt sich, vielleicht wg Windows Update
Erstellt im Forum Fragen zur Anwendung von Frank_fragt
3 05.02.2024 16:15
von P.Roch • Zugriffe: 386
Windows 11 23H2 und Journal Playback Hooks
Erstellt im Forum Fragen zur Anwendung von Marius_
4 26.12.2023 18:38
von R.Wilke • Zugriffe: 230
Windows 11
Erstellt im Forum Fragen zur Anwendung von uljoman
4 17.09.2023 18:32
von R.Wilke • Zugriffe: 336
Dragon Legal 16 – erste Erfahrungen
Erstellt im Forum Berichte und Tipps von Marius_
4 29.03.2023 17:27
von royaltyrant • Zugriffe: 1079
PC mit Dragon unter Windows 11 extrem langsam
Erstellt im Forum Fragen zur Anwendung von CT1956
9 07.10.2023 20:02
von CT1956 • Zugriffe: 1680
Windows 11 und Dragon
Erstellt im Forum Fragen zur Anwendung von Harald
14 20.01.2022 15:08
von Rene • Zugriffe: 4423
Hat irgendjemand Infos/Erfahrungen mit Dragon 13 Premium/15 DPI und Windows 11?
Erstellt im Forum Fragen zur Anwendung von Khaine
1 07.12.2021 15:01
von Falconi • Zugriffe: 1355
NatSpeak 12 und Windows 10
Erstellt im Forum Fragen zur Anwendung von gunnit50
3 18.06.2021 16:52
von Sabine • Zugriffe: 283
Dragon von Win 7 nach Win 10 umziehen
Erstellt im Forum Fragen zur Anwendung von Joschka
2 02.03.2021 12:56
von Joschka • Zugriffe: 345
Die geänderte Auswahl kann nicht angezeigt werden
Erstellt im Forum Fragen zur Anwendung von Harald
17 24.07.2022 17:16
von Kai-Hawaii • Zugriffe: 985
 Sprung  
Xobor Ein Kostenloses Forum | Einfach ein Forum erstellen
Datenschutz