KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Held down keys won't release
Topic Summary:
Created On: 11/16/2020 07:54 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 Held down keys won't release   - TheCyborgManatee - 11/16/2020 07:54 PM  
 Held down keys won't release   - Edgar - 11/17/2020 11:17 AM  
 Held down keys won't release   - monkey8 - 11/21/2020 06:03 AM  
 Held down keys won't release   - monkey8 - 11/24/2020 02:32 PM  
 11/17/2020 11:17 AM
User is offline View Users Profile Print this message

Author Icon
Top-Tier Member

Posts: 1111
Joined: 04/03/2009

Originally posted by: TheCyborgManatee   the release command doesn't appear to do anything. 


when I say "shift click" […] my cursor will be immediately pinned to the upper left

When first published, the Hold/Release key/button scripts had a typo error which would have caused your first problem. It sounds like your "Hold" command is working properly; just for completeness it should look something vaguely like this:

Sub Main

   If ListVar1 = "WINDOWS Key" Then keybd_event(VK_LWIN,0,0,0)
   If ListVar1 = "CONTROL Key" Then keybd_event(VK_CTRL,0,0,0)
   If ListVar1 = "SHIFT Key" Then keybd_event(VK_SHIFT,0,0,0)
   If ListVar1 = "ALT Key" Then keybd_event(VK_ALT,0,0,0)
   If ListVar1 = "SPACE Key" Then keybd_event(VK_SPACE,0,0,0)


End Sub

The "Release" command should look something like this:

Sub Main

   If ListVar1 = "WINDOWS Key" Then keybd_event(VK_LWIN,0, 2,0)
   If ListVar1 = "CONTROL Key" Then keybd_event(VK_CTRL,0, 2,0)
   If ListVar1 = "SHIFT Key" Then keybd_event(VK_SHIFT,0, 2,0)
   If ListVar1 = "ALT Key" Then keybd_event(VK_ALT,0, 2,0)
   If ListVar1 = "SPACE Key" Then keybd_event(VK_SPACE,0, 2,0)

End Sub

Note that at the end of each line there is a series of comma separated numerals; for the "Hold" command they should all be 0s, for the "Release" command the middle should be a 2.

You'll have to post the code to your "Shift Click" command, my look something like this:


   x As Long
   y As Long

End Type

Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINT) As Long

Sub Main

   Dim z As POINT

   GetCursorPos z 'Get cursor's current Coordinates
   Wait 0.2
   SendKeys "+{ClickLeft " & z.x &"," & z.y &"}", 1

End Sub

Note that, for me, the line which starts out with "Declare Function" and ends with "As Long" is all on one line; if it is broken up all but the last line must end with a "_". Also, the word POINT might be different in your version but it doesn't matter as long as it is consistent in all three locations in the code.


DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Office 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card with 3 1920x1080 monitors

KnowBrainer Speech Recognition » KnowBrainer Software and Support » Held down keys won't release

31981 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 1 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 458 guests browsing this forum, which makes a total of 459 users using this forum.

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