![]() |
KnowBrainer Speech Recognition | ![]() |


|
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 |
|
![]() |
- Sandra.H.H@ | - 10/17/2006 05:07 AM |
![]() |
- Hilary | - 10/18/2006 12:55 PM |
![]() |
- Sandra.H.H@ | - 10/19/2006 04:14 AM |
![]() |
- Hilary | - 10/19/2006 10:40 AM |
|
|
|||
|
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
|
|||
|
|
|||
|
|
|||
|
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.) |
|||
|
|
|||
|
|
|||
|
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 |
|||
|
|
|||
|
|
|||
|
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 Option Explicit For the Control key: Command name: Control Key <dirupdown> Script: Option ExplicitDeclare 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
|
|||
|
|
|||
FuseTalk Standard Edition v4.0 - © 1999-2013 FuseTalk™ Inc. All rights reserved.