KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Commands for (un)locking SHIFT and CTRL keys in Microsoft Excel and Windows Explorer
Topic Summary: Commands for (un)locking SHIFT and CTRL keys in Microsoft Excel and Windows Explorer
Created On: 10/17/2006 05:07 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 10/17/2006 05:07 AM
User is offline View Users Profile Print this message


Sandra.H.H@
Junior Member

Posts: 2
Joined: 10/17/2006

Hi folks,

looking for hands-free navigation in Microsoft Excel to compensate my broken hand I'm wondering (1) if there's any macro/command to lock CTRL- or SHIFT-keys allowing multi-select, multi-copy or filling of cells?

By the same token, does anyone know (2) a command to select the small cross in the lower right (see Screenshot) and lock-in the mouse respectively. Usually you have to press the mouse button a few seconds.

Any ideas would be gratefully appreciated. Sandra




 10/18/2006 12:55 PM
User is offline View Users Profile Print this message


Hilary
Junior Member

Posts: 13
Joined: 10/08/2006

Hi Sandra,

 

For your first question, see

 

http://70.151.94.93/legacy/read.php?f=2&i=28866&t=28806#reply_28866

 

For your 2nd question here are 2 commands (one for left mouse button, one for right button):

 

1. Mouse

 

( list needs Press, Release in it – use exact capitalisation)

 

Script is as follows:

 

' From Bruce Tjosvold on KNOWBRAINER phorum

' http://forum.knowbrainer.com/read.php?f=2&i=20784&t=20685#reply_20784

 

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, _

ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, _

ByVal dwExtraInfo As Long)

 

Type POINTAPI 'Declare types

x As Long

y As Long

End Type

'

Declare Function GetCursorPos Lib "user32" _

(lpPoint As POINTAPI) As Long 'Declare API

 

Const MOUSEEVENTF_LEFTDOWN = &H2

Const MOUSEEVENTF_LEFTUP = &H4

 

Sub Main

 

Dim z As POINTAPI 'Declare variable

Dim xpos As Long, ypos As Long

 

GetCursorPos z 'Get Coordinates

xpos = CLng(z.x)

ypos = CLng(z.y)

 

If ListVar1 = "Release" Then

mouse_event MOUSEEVENTF_LEFTUP, xpos, ypos, cButt, dwEI

Else

mouse_event MOUSEEVENTF_LEFTDOWN, xpos, ypos, cButt, dwEI

End If

 

End Sub

 

2.  Right Mouse

Script as follows:

 

' From Bruce Tjosvold on KNOWBRAINER phorum

' http://forum.knowbrainer.com/read.php?f=2&i=20784&t=20685#reply_20784

 

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, _

ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, _

ByVal dwExtraInfo As Long)

 

Type POINTAPI 'Declare types

x As Long

y As Long

End Type

'

Declare Function GetCursorPos Lib "user32" _

(lpPoint As POINTAPI) As Long 'Declare API

 

Const MOUSEEVENTF_RIGHTDOWN = &H8

Const MOUSEEVENTF_RIGHTUP = &H10

 

Sub Main

 

Dim z As POINTAPI 'Declare variable

Dim xpos As Long, ypos As Long

 

GetCursorPos z 'Get Coordinates

xpos = CLng(z.x)

ypos = CLng(z.y)

 

If ListVar1 = "Release" Then

mouse_event MOUSEEVENTF_RIGHTUP, xpos, ypos, cButt, dwEI

Else

mouse_event MOUSEEVENTF_RIGHTDOWN, xpos, ypos, cButt, dwEI

End If

 

End Sub

 

(Let me know if you need any help setting up these commands.)

 10/19/2006 04:14 AM
User is offline View Users Profile Print this message


Sandra.H.H@
Junior Member

Posts: 2
Joined: 10/17/2006

Hi Hilary,

thank You very much, I will try it immediately. Unfortunately Google searches considering DNS in KB give an annoying number of broken links.

Sandra

 10/19/2006 10:40 AM
User is offline View Users Profile Print this message


Hilary
Junior Member

Posts: 13
Joined: 10/08/2006

New link for Bruce’s command:

http://70.151.94.93/legacy/read.php?f=2&i=20784&t=20685

 

In case you can’t access the link for holding down the Shift key, here is the command:

 

Command name: Shift Key <dirupdown>

 

Script:

'http://70.151.94.93/legacy/read.php?f=2&i=28866&t=28806#reply_28866

'Remember that you’ll need to change the Dragon options
'to not have Shift key to force dictation recognition,
'otherwise you won’t be able to release the Shift key by voice.
'(Dragon will recognise “Shift Key Up” as text rather than a command.)

Option Explicit
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_KEYUP = &H2
Sub Main()
Const VK_SHIFT = &H10
Const VK_CONTROL = &H11
' Press or release the button.
If UCase(ListVar1) = "DOWN" Then
keybd_event VK_SHIFT, 0, 0, 0 '
DoEvents
End If
If UCase(ListVar1) = "UP" Then
keybd_event VK_SHIFT, 0, KEYEVENTF_KEYUP, 0
DoEvents
End If
End Sub
 

For the Control key:

Command name: Control Key <dirupdown>

 

Script:

Option Explicit
Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_KEYUP = &H2
Sub Main()
Const VK_SHIFT = &H10
Const VK_CONTROL = &H11
' Press or release the button.
If UCase(ListVar1) = "DOWN" Then
keybd_event VK_CONTROL, 0, 0, 0 '
DoEvents
End If
If UCase(ListVar1) = "UP" Then
keybd_event VK_CONTROL, 0, KEYEVENTF_KEYUP, 0
DoEvents
End If
End Sub

 

Statistics
27365 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 108 guests browsing this forum, which makes a total of 112 users using this forum.

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