KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: change behavior of ALT TAB
Topic Summary: make it more accessible
Created On: 03/18/2010 09:28 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 change behavior of ALT TAB   - jask - 03/18/2010 09:28 AM  
 change behavior of ALT TAB   - Alan Cantor - 03/18/2010 10:56 AM  
 change behavior of ALT TAB   - jask - 03/18/2010 12:05 PM  
 change behavior of ALT TAB   - Lunis Orcutt - 03/18/2010 12:52 PM  
 change behavior of ALT TAB   - jask - 03/18/2010 02:10 PM  
 change behavior of ALT TAB   - monkey8 - 03/18/2010 02:12 PM  
 change behavior of ALT TAB   - jask - 03/18/2010 02:29 PM  
 change behavior of ALT TAB   - R. Wilke - 03/18/2010 02:45 PM  
 change behavior of ALT TAB   - jask - 03/18/2010 05:46 PM  
 change behavior of ALT TAB   - Alan Cantor - 03/18/2010 07:25 PM  
 change behavior of ALT TAB   - monkey8 - 03/18/2010 06:07 PM  
 change behavior of ALT TAB   - monkey8 - 03/18/2010 05:50 PM  
 change behavior of ALT TAB   - jask - 03/18/2010 07:28 PM  
 change behavior of ALT TAB   - monkey8 - 03/18/2010 07:56 PM  
 change behavior of ALT TAB   - jask - 03/19/2010 09:17 AM  
 change behavior of ALT TAB   - jask - 03/19/2010 09:39 AM  
 change behavior of ALT TAB   - bluerhino - 03/21/2010 06:55 PM  
 change behavior of ALT TAB   - Lunis Orcutt - 03/21/2010 09:23 PM  
Keyword
 03/18/2010 09:28 AM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

hi everyone,

I was wondering if any of you know a way, to make the behavior of the Windows function ALT TAB more comfortable. I was thinking something along the lines off a command, that brings up the window containing all the applications that are running and then letting me choose by saying a number.

I googled but couldn't find any good solutions. then i thought of an advanced script, that would press the alt key, keep it pressed, and wait for a number, and then hit tab as often as required. Thanks to Lindsay I am capable of creating a command, that's presses the alt keybut I don't know how to insert a variable into a running command. Is that even possible?

Regards Janosch

 03/18/2010 10:56 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 1481
Joined: 12/08/2007

Try built in commands such as "Switch to Next Window," "Switch to Previous Window," and "Switch to XXX," where XXX is the name, or a part of a name, that is visible on the task bar.  (E.g., "Switch to Inbox," "Switch to Internet Explorer," "Switch to KnowBrainer Forums" etc.)

I'm not sure where the following script came from, but I am almost certain that someone on this forum developed it. You can bring up a window by saying Switch to 1, 2, up to 10. "1" is the window closest to Start menu. Depending on how you have configured your system, you may need to modify the "SendKeys" line. This script contains two versions of this line, with one commented out.

Name: Switch to <1_10>

Declare Function SetForegroundWindow Lib "user32" _
Alias "SetForegroundWindow" (ByVal Hwnd As Long)As Long
Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long

Sub Main
    Dim h1 As Long
    ' Get the taskbar window
    h1 = FindWindow ("Button","Start" )
    SetForegroundWindow(h1)
    Wait 0.1
    SendKeys"{Tab}{Right "+ListVar1+"}{Left}{Space}"
'    SendKeys"{Tab}{Right "+ListVar1+"}{Space}"
End Sub
 

 

 03/18/2010 12:05 PM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

Hello Alan,

thanks for your reply. I tried the script but it didn't work for me. I modified it a bit until it did This is what I got:

Sub Main
    SendSystemKeys "{Ctrl+Esc}"
    SendKeys"{Esc}"
    Wait 0.1
    number = ListVar1
    SendKeys"{Tab}"
    For I = 2 To number Step 1
    SendKeys "{Right}"
    Next I
    SendKeys"{Space}"
End Sub

  most probably not the smoothest way but it works :-)

  still, this is a good start but not perfect since i often have around 15 open windows which causes windows to stack them in the taskbar. which requires me to say switch to "<number of group>, up <number of windows>, return" - quite long in comparison to ALT+TAB. I dont like switch to next and previous windows, either, they are way to slow. I shortened those commands to next app / previous app but desire something faster that gives me an overview of the tabs and lets me choose a number.

regards, Janosch (who is trying to bring mouseless and keyboardless control to perfection.) :-)

 03/18/2010 12:52 PM
User is online View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22591
Joined: 10/01/2006

If you have enough monitor space to spare, you might consider moving the taskbar to the left or right side of your monitor as opposed to the bottom. When working with documents, e-mail messages and Internet Explorer, most of us need more vertical room than horizontal. If you extend your taskbar out to about 2 inches from the side of your monitor you should be able to read the text in every icon. This is also a great way to handle multiple monitors. You might also set the nest option so that nesting only occurs when you run out of taskbar space. We can view approximately 30 Windows before nesting starts.

The reason why we mentioned this is because in many situations, such as Microsoft Office applications, you can simply say
switch to <name of file> to pull up that Window. For example, if we have 2 Excel customer spreadsheets labeled as “Johnny Cash” and “June Carter” all we have to do is say switch to June Carter or just switch to June to pull up the June Carter spreadsheet. This is more precise than saying Switch to Excel. Sometimes keeping it simple is best; even though it rubs us the wrong way . Unfortunately, this system doesn't work for everything and even though KnowBrainer 2008 includes a Switch to Window <1-10> command, we rarely use it because we find saying switch to <file or window name>
to be more intuitive and natural. Besides, by the time you get to the 5th Window you have to waste additional time counting which pretty much hoses the whole efficiency concept.

However, Internet Explorer is a different animal altogether. Because we frequently toggle between 5 and 8 tabs in Internet Explorer, KnowBrainer includes a global
<1st - 8th> Tab and a Refresh <1st - 8th> Tab command. As you have probably already guessed, the Refresh <1st - 8th> Tab command switches to Internet Explorer, chooses the appropriate tab and refreshes the browser. We're also experimenting with a Refresh All Tabs command today and will add it to KnowBrainer if there is any interest.


-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

 03/18/2010 02:10 PM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

hi, 

I used to have my taskbar to the right side but it didnt feel comfortable. a second monitor  is not an option since I carry around my laptop pretty  much anywhere.

 I will keep an eye open for a solution that includes a kind of a browser for alt-tab.

  regarding the tab option, I implemented that for my Firefox, too. I use "link <number>" (left click link), "new <number>" (open link  in new tab), "go <number>" (go to tab with number X) . Works like a charm.

There are those still a few things I'm looking into except for the tab-browser i.e. can you make links in e-mails (outlook) clickable by speech?

 one of the most useful commands I have is the word "return". I mapped that to keystroke "enter". Especially when browsing or for MsgBoxes that comes in very handy...

 

Regards Janosch

 03/18/2010 02:12 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Which operating system are you using?

-------------------------


www.pcbyvoice.com
www.pcbyvoice.co.uk

 03/18/2010 02:29 PM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

hi Lindsay,

 I use exclusively Windows XP. Service pack 3.

 

Regards Janosch

 03/18/2010 02:45 PM
User is offline View Users Profile Print this message

Author Icon
R. Wilke
Top-Tier Member

Posts: 4391
Joined: 03/04/2007

Well, if you were using Windows 7, Lindsay would have asked you to set the display to Areo design, and try WinKey + Tab.

Thanks for the tip, mate.

Rüdiger

 



-------------------------

Well, it's past the point where we can make any changes in the code, but we can still make changes to the Easter Egg!

 03/18/2010 05:46 PM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

hi Rüdiger,

thanks for the hint, that gave me the name of the Windows 7 app which I could then track down to Windows XP. It looks nice but it It's not what I was looking for. So I googled some more and even more and more :-)

anyhow, I found a program that does exactly what I wanted to, its name is "VistaSwitch" ( works for windows XP, too). I configured it so, that shows a numbered list of all tasks..  The only problem is,it can only work with numbers 1 to 9.  when you have more tasks than that, you have to use the arrow keys. I figured I could get around that by simply making a command like the following:

Name: app <1to9> <1to9>

Sub Main
    number = ListVar1
    For I = 2 To number Step 1
    SendKeys "{Down}"
    Next I
    SendKeys "{Space}"
End Sub

  Works pretty well, I only wish it was a bit faster. I googled and tried to find something in the Dragon help, but there seems to be nothing that controls the delay. Do you know of a way to speed up the input of the {Down} key?

 

 regards Janosch

 03/18/2010 07:25 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 1481
Joined: 12/08/2007

Quote:

Sub Main

number = ListVar1

For I = 2 To number Step 1

SendKeys "{Down}"

Next I

SendKeys "{Space}"

End Sub

Works pretty well, I only wish it was a bit faster.

 

This should speed it up, but you probably won't notice a difference for smallish values of listvar1.

 Sub Main

number = ListVar1 - 1

SendKeys "{Down " & Str$(number) & "}"

SendKeys "{Space}"

End Sub

 

 03/18/2010 06:07 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

Quote:
Well, if you were using Windows 7, Lindsay would have asked you to set the display to Areo design, and try WinKey + Tab

Rüdiger, Sure would have been easier, the problem is that once you call ALT + TAB and hold the ALT key with Windows XP you can't then use the normal voice commands, e.g. "press tab", to move between the tasks (not even with a  SendSystemKeys script) and thus you need to use keyboard events as in the second script.  Finally you have to use keyboard events again to select the highlighted task.  With Windows 7 and Vista using the ALT + TAB is a lot easier. You can of course amalgamate the lines from the various scripts to have one or two scripts and they all work very fast.  Anyway 20 minutes doing those scripts is light relief compared to 3 days of artificial intelligence!

Janosch, I noticed after posting the scripts that you have found another method of doing it with a free application.  You can also use VoicePower but of course it's not free.

Lindsay

I should add that the above scripts are for XP, if you can't work out how to use it with Windows 7 and Vista then let me know.



-------------------------


www.pcbyvoice.com
www.pcbyvoice.co.uk

 03/18/2010 05:50 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

With Windows XP you can access tasks straight from the taskbar using various scripts but you seem to have this working (I will give you a script if you don't).
To use the ALT + TAB method by voice you need the following scripts. To call ALT + TAB and hold the ALT key use the following script (e.g. "show tasks"

Declare Function keybd_event Lib "user32.dll" (ByVal vKey As _
Long, bScan As Long, ByVal Flag As Long, ByVal exInfo As Long) As Long in
Sub Main
' script by Lindsay Adam March 2010
Const VK_ALT = 18
Const VK_TAB = 9
keybd_event(VK_ALT,0,0,0)
keybd_event(VK_TAB,0,0,0)
keybd_event(VK_TAB,0,2,0)
End Sub

To move between tasks use the following script (e.g. "move one task", "move four tasks" etc, call the script something like "move <1to9> tasks" and this will use the <0to9> that comes with the commands file).  Incidentally if you want to cut out all the If ListVar1 ... lines below then just use a list of numbers instead of "one,two…" etc (it was easier for me to cut and paste this)

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
' script by Lindsay Adam March 2010
Dim i, j As Integer
Const VK_TAB = 9
If ListVar1 = "one" Then j = 1
If ListVar1 = "two" Then j = 2
If ListVar1 = "three" Then j = 3
If ListVar1 = "four" Then j = 4
If ListVar1 = "five" Then j = 5
If ListVar1 = "six" Then j = 6
If ListVar1 = "seven" Then j = 7
If ListVar1 = "eight" Then j = 8
If ListVar1 = "nine" Then j = 9
For i = 1 To j
keybd_event(VK_TAB,0,0,0)
keybd_event(VK_TAB,0,2,0)
Next i
End Sub

And finally to select the task highlighted in the ALT + TAB window use the following script (e.g. call it something like "select task"

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
' script by Lindsay Adam March 2010
Const VK_ALT = 18
Const VK_TAB = 9
keybd_event(VK_ALT,0,2,0)
keybd_event(VK_TAB,0,2,0)
End Sub

Finally what is the reason that you want to use the ALT + TAB method since you can go direct to the tasks from the taskbar or by using
switching commands (is it simply because the tasks are not very clearly labelled on the taskbar sometimes?)

Let me know how you get on as I have tried all of the above with XP service Pack 3 and they all seemed to work fine, wish I wrote this script when I was still using XP:-).
I can't believe how fast 32-bit XP is compared to Windows 764 bit, makes me want to switch back but I presume it is just because I have not loaded up all my other software on the XP system.

Lindsay



-------------------------


www.pcbyvoice.com
www.pcbyvoice.co.uk

 03/18/2010 07:28 PM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

Hi Lindsay,


thanks once again for your really extensive help. your approach seems quite complicated to me but that's probably just because I don't know how to code properly :-)


I'm really happy with my solution since it adds some additional eye candy. The only thing I would like to change is the speed. Do you know how I could improve speed on my script? Each key gets sent with a delay. Although I googled a lot and also looked into the dragon help I couldn't find anything about the delay.

Sub Main
    number = ListVar1
    For I = 2 To number Step 1
    SendKeys "{Down}"
    Next I
    SendKeys "{Space}"
End Sub

 

EDIT: as for the "Switch to" Command ... I find it often not reacting properly to my application windows + when working i have between 10 and 20 open windows which makes the task-bar look very overloaded. The application I use now gives a real nice Overview (see attached screen)...

 regards Janosch



vistaswitch.jpg
vistaswitch.jpg  (15 KB)

 03/18/2010 07:56 PM
User is offline View Users Profile Print this message

Author Icon
monkey8
Top-Tier Member

Posts: 1987
Joined: 01/14/2008

If your list is only the digits 1 to 9 this will speed it up: (I am only using one list) e.g.  "app 4"

Sub Main
 SendKeys"{Down "+ListVar1+"}{Space}"
End Sub

Incidentally I would use your approach as well if I had that application when I had XP:-)

Lindsay

if you want to move down more than nine applications at a time then you need to use a complex list which is basically a list like:

1\one
2\two
..
...
19\nineteen
20\twenty

the script then becomes:

Sub Main
count = Mid(ListVar1,1,InStr(ListVar1,"\" )-1)
SendKeys"{Down "+count+"}{Space}"
End Sub

Do you have a link for your application, thanks. Also although the approach I have mentioned above looks complicated it is exactly the same as the approach you are using except it is using the inbuilt application which you normally get by pushing ALT + TAB.  If you implemented it you'd see what I mean. You can combine the last two scripts shown above so you have just have two voice commands which you will have with your application.  However no eye candy except the Windows XP Alt + Tab app:-)



-------------------------


www.pcbyvoice.com
www.pcbyvoice.co.uk

 03/19/2010 09:17 AM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

Hi,
the tool I'm using is called Vista switcher. You can download it here: http://www.ntwind.com/software/vistaswitcher.html

I adjusted some of the settings to get the output shown in the screenshot.

Thanks for the hints considering they use of a faster command. It works, although it crashed all my windows twice now. I can't reproduce the error. Simply all open windows closed down. I will keep an eye on that. Also dragon wouldn't let me write the following:
number = ListVar1-1

I had to write
number = Listvar1
number 2 = number-1

Weird.

Regards, Janosch
 03/19/2010 09:39 AM
User is offline View Users Profile Print this message


jask
Power Member

Posts: 74
Joined: 02/17/2010

i found the reason for the window crashes. when in the "vista-switcher"-window you can press a (selects all currently open windows) and then t (terminates all windows). when i say i.e. "app 7" and dragon gets me wrong because i dont pronounce correctly the following gets send: "at seven" ... you see the first two letters? ;-) thats rough. Unfortunately you cant deactivate this function. i will rename my command to something thats far away from AT :-) and maybe mai lthe "vista-switcher"s author about it...

 

Regards,

Janosch

 03/21/2010 06:55 PM
User is offline View Users Profile Print this message


bluerhino
Junior Member

Posts: 6
Joined: 03/04/2010

This is from the DNS 10 manual from the Nuance site:

 

When you’re pressing keys, you can press any combination of the modifier keys (SHIFT, CTRL, and ALT) at the same time as another key, such as a letter. For example, you can say:

 “Press Control Z” (undoes last action)

 “Press Alt F” (opens File menu)

 “Press Shift Tab” (moves backward through dialog box options)

Dragon ignores the command “Press Control Alt Delete” (the keyboard shortcut for restarting a computer).

 

Example: “Press ALT Tab” will allow you to scroll through the open windows while holding ALT (once the open programs show) and pressing Shift and then Tab will allow you to scroll backwards through the list.

 

Is Dragon able to duplicate this?

 03/21/2010 09:23 PM
User is online View Users Profile Print this message

Author Icon
Lunis Orcutt
Top-Tier Member

Posts: 22591
Joined: 10/01/2006

NaturallySpeaking cannot do {Ctrl+Alt+Del} but KnowBrainer 2008 can and KnowBrainer uses logical command names like Other Window and Start Task Manager {Ctrl+Alt+Del}. However, you can always substitute saying press control shift escape.

-------------------------


Click KB 2012 REV D to Download a 30 Day Evaluation of KnowBrainer 2012 


 


 


 

Statistics
27364 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 4 users logged in.
The most users ever online was 2028 on 04/05/2013 at 07:36 PM.
There are currently 93 guests browsing this forum, which makes a total of 97 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2013 FuseTalk™ Inc. All rights reserved.