<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>VoiceBot RSS: Continue pressing key until interrupted</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=bef7a109-f357-4b2f-a475-80407c103597" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=bef7a109-f357-4b2f-a475-80407c103597</link>
<description>VoiceBot RSS: Continue pressing key until interrupted</description>
<lastBuildDate>Sat, 02 May 2026 17:18:14 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=bef7a109-f357-4b2f-a475-80407c103597</generator>
<item>
<title>RE: Continue pressing key until interrupted</title>
<link>https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#4</link>
<pubDate>Wed, 07 Nov 2018 16:56:33 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#4</guid>
<category>VoiceBot</category>
<description><![CDATA[Ok, try the attached script out. It repeats the W key quickly, it's as close as I could get to how it behaves when you hold the key down (test it in notepad if to see what it does). Pressing left shift should stop it from running.]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, try the attached script out. It repeats the W key quickly, it's as close as I could get to how it behaves when you hold the key down (test it in notepad if to see what it does). Pressing left shift should stop it from running.
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Continue pressing key until interrupted</title>
<link>https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#3</link>
<pubDate>Sat, 03 Nov 2018 10:50:00 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#3</guid>
<category>VoiceBot</category>
<description><![CDATA[Thanks Keith,
unless you come up with a better solution, for now, I'm just going to have an action to "Press key: SHIFT+W", then the macro which waits for a cancelling keypress, then another action to "Release key: SHIFT+W".
it's a little kludgey, but It works.
Thanks,
Van]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks Keith,<br/>
<br/>
unless you come up with a better solution, for now, I'm just going to have an action to "Press key: SHIFT+W", then the macro which waits for a cancelling keypress, then another action to "Release key: SHIFT+W".<br/>
it's a little kludgey, but It works.<br/>
<br/>
Thanks,<br/>
<br/>
Van
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Continue pressing key until interrupted</title>
<link>https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#2</link>
<pubDate>Fri, 02 Nov 2018 18:23:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597#2</guid>
<category>VoiceBot</category>
<description><![CDATA[SendKeyDown is different than how physically holding a key on a keyboard works. When you physically hold a key, the key actually gets repeated (try it in Notepad). SendKeyDown just sets the key state to down once until it's released.
Next week I will do some testing to see if there's a way to sc...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
SendKeyDown is different than how physically holding a key on a keyboard works. When you physically hold a key, the key actually gets repeated (try it in Notepad). SendKeyDown just sets the key state to down once until it's released.<br/>
<br/>
Next week I will do some testing to see if there's a way to script holding the W key in a way that a game would recognize it as a held key.
</div>
]]></content:encoded>
</item>
<item>
<title>Continue pressing key until interrupted</title>
<link>https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597</link>
<pubDate>Thu, 01 Nov 2018 22:46:05 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/continue-pressing-key-until-interrupted/?ID=bef7a109-f357-4b2f-a475-80407c103597</guid>
<category>VoiceBot</category>
<description><![CDATA[From an earlier discussion, I copied text that Keith Lammers had provided for having Voicebot continuously presses (presses and hold), until another key is pressed, but that doesn't seem to be working.
Code
Copy
Select All
using System;
using System.Drawing;
public static class VoiceBotScri...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
From an earlier discussion, I copied text that Keith Lammers had provided for having Voicebot continuously presses (presses and hold), until another key is pressed, but that doesn't seem to be working.<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019de9b2ac6775fa88b5b4b96e43f130" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019de9b2ac6775fa88b5b4b96e43f130Js'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019de9b2ac6775fa88b5b4b96e43f130Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class VoiceBotScript
{
    public static void Run(IntPtr windowHandle)
    {
        // Send W continuously
        BFS.Input.SendKeyDown("{VK_87}");
        // loop forever
        while (true)
        {
            // breaks loop if you press any of the following  keys: SHIFT
            if (BFS.Input.IsKeyDown("15"))
                        {
                            BFS.Input.SendKeyUp ( "{VK_87}" );
                            break;
                      };            
            // sleep for a bit so we don't run-up the CPU
            BFS.General.Sleep(50);
        }

       BFS.Input.SendKeyUp ( "{VK_87}" );
    }
}</pre><textarea id="code019de9b2ac6775fa88b5b4b96e43f130" name="code019de9b2ac6775fa88b5b4b96e43f130" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
The code above simply presses "w" once, and stops.<br/>
This is for use in the game,. DayZ, for running long distances. I want to just 'aim' and then when needed press a key to stop the running. (I got it to work earlier (continuously press/hold W, but then couldn't get it to stop, no matter what, so I had to exit voicebot.<br/>
<br/>
Any ideas? <br/>
<br/>
Thanks,<br/>
<br/>
Van<br/>
<br/>
EDIT: I've also added in a number of other break keystrokes, none of which work:<br/>
====================================<br/>
     // Send W continuously<br/>
        BFS.Input.SendKeyDown("{VK_119}");<br/>
        // loop forever<br/>
        while (true)<br/>
        {<br/>
            if (BFS.Input.IsKeyDown("15"))     { BFS.Speech.TextToSpeech("Virtual Key 15 detected down");  BFS.General.Sleep(1250);  break; }<br/>
            if (BFS.Input.IsKeyDown("14"))  { BFS.Speech.TextToSpeech("Virtual Key 14 detected down"); BFS.General.Sleep(1250); break; }<br/>
            if (BFS.Input.IsKeyDown("32")) { BFS.Speech.TextToSpeech("Virtual Key 32 detected down"); BFS.General.Sleep(1250); break;}<br/>
====================================<br/>
<br/>
The script, in fact, stays running, no matter which key I press (and I've tried a lot), I have to stop it by cliking the icon in the systray.
</div>
]]></content:encoded>
</item>
</channel>
</rss>