Author Topic: Checking pressing  (Read 27673 times)

0 Members and 2 Guests are viewing this topic.

NooBAsTiK

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 0
    • View Profile
    • SquaD Skulls
Re: Checking pressing
« Reply #30 on: January 31, 2015, 02:52:16 PM »
Some operations take a long time, and would not want them distracted while holding the button.

NooBAsTiK

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 0
    • View Profile
    • SquaD Skulls
Re: Checking pressing
« Reply #31 on: January 31, 2015, 02:55:21 PM »
Have you tried Phobophile's recommendation? Вы пробовали Phobophile рекомендации?

Пока нет, еле разобрался с записью.

Yet, barely figured out the record.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Checking pressing
« Reply #32 on: January 31, 2015, 04:13:03 PM »
Quote
Да у меня будет посложнее задача.
Кратно: Я играю в авиасимулятор и часто пользуюсь закрылками которые выпускаются от 0 до 60 градусов. Для себя определил 4 положения:
1. 0 градусов - полет
2. 8-9 градусов - боевое положение (время выпуска от 0 до 8-9 градусов около 3 секунд)
3. 17-18 градусов - взлет, маневрирование (от 8-9 около 5 секунд)
4. 50 градусов - посадка (от 18 около 9 секунд)

И вот тут получается следующий вопрос как выстроить логику:
Например я говорю "закрылки посадка"  надо держать кнопку 3+5+9=17 секунд, потом "закрылки боевое"  держать  кнопку которая убирает закрылки надо 9+5=14 секунд и так далее. Просто больше переменных делать?

Используете ли вы те же кнопки для всех четырех задач? Или будет необходимо отслеживать множество различных комбинаций?

Какие кнопки?

Do you use the same keys for all four tasks? Or would you have to keep track of different key combinations?

What are the keys?
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

NooBAsTiK

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 0
    • View Profile
    • SquaD Skulls
Re: Checking pressing
« Reply #33 on: January 31, 2015, 04:44:05 PM »
Две кнопки.
1 выпускает
2 убирает

Two buttons.
1 releases
2 removes

1 F
2 Lshift+f
« Last Edit: January 31, 2015, 04:46:12 PM by NooBAsTiK »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Checking pressing
« Reply #34 on: January 31, 2015, 04:50:36 PM »
OK.

Let me think about it.  Позвольте мне думать об этом
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Checking pressing
« Reply #35 on: January 31, 2015, 05:28:15 PM »
Is the other command that we modified for you today working properly?

The best way to do solve your problem for controlling the flaps is probably to use a bit of simple math. This means that you will need to enable the python plugin.

I can try to create a working command for you, but it will only work if you always use voice control to control the flaps.  If you use the keyboard to move the flaps it will cause problems and I don't think there is a practical solution for that.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Checking pressing
« Reply #36 on: January 31, 2015, 09:48:10 PM »

I can try to create a working command for you, but it will only work if you always use voice control to control the flaps.  If you use the keyboard to move the flaps it will cause problems and I don't think there is a practical solution for that.

If you want to use the keyboard at times you could use something like AutoHotKey, so when you use the shortcut keys they could trigger an event in VC,

I have an Autohotkey script that I converted to an .exe file, when executed it tells VC to launch Pseudo TV Live in xbmc, so that way VC can keep track of when Pseudo TV Live is On or Off

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Checking pressing
« Reply #37 on: January 31, 2015, 11:25:54 PM »
Yes, you can also do that with the hook plugin, but in this case we are talking about keeping track of how long the button is held down for, and although it could theoretically be done, I think it is more trouble than it is worth.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Checking pressing
« Reply #38 on: February 01, 2015, 01:22:20 AM »
Yes, you can also do that with the hook plugin, but in this case we are talking about keeping track of how long the button is held down for, and although it could theoretically be done, I think it is more trouble than it is worth.

I agree, it can be a lot of trouble,

I knew I had come across an autohotkey script that looks like it could do what NooBAsTiK was looking for, it would just need to be modified so it could send an event with a payload for the amount of time the key was held down instead of sending a letter

i just couldn't find it before but here's what i thought he could use
http://www.autohotkey.com/board/topic/97786-variable-in-counter-script/

NooBAsTiK

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 0
    • View Profile
    • SquaD Skulls
Re: Checking pressing
« Reply #39 on: February 01, 2015, 06:07:08 AM »
Спасибо! Это код для Pyton?

Thank U! This code Pyton?

NooBAsTiK

  • Jr. Member
  • **
  • Posts: 33
  • Karma: 0
    • View Profile
    • SquaD Skulls
Re: Checking pressing
« Reply #40 on: February 01, 2015, 06:22:33 AM »
я думаю, что попробую сделать через мап. С написанием кода в питоне слишком сложно, это всетаки игра :)

I think I'll try to do through the MAP. From writing code in Python too difficult, it is certainly this game :)

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Checking pressing
« Reply #41 on: February 01, 2015, 12:09:36 PM »
Спасибо! Это код для Pyton?

Thank U! This code Pyton?


If you're asking about what I posted, no it's not Python, it's another form of script, (I find it easier than Python, but not as powerful).

Если вы спрашиваете о том, что я написал, нет, это не Питон, это еще одна форма сценария, (мне проще, чем Python, но не такой мощный).
« Last Edit: February 01, 2015, 12:48:27 PM by jitterjames »

Phobophile

  • Jr. Member
  • **
  • Posts: 36
  • Karma: 7
    • View Profile
    • Facebook
Re: Checking pressing
« Reply #42 on: February 01, 2015, 03:10:56 PM »
Ну примерно вот так, я думаю.
I think, something like this:

Code: [Select]
<commandGroup open="True" name="Flight Sim" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="108" name="Flight Mode" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<if ifBlockDisabled="False" ifNot="False">
<ifType>(A)&lt;(B)</ifType>
<ifParams>{var.mode}&amp;&amp;{1}</ifParams>
<then>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result = {1} - {var.mode}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Открываем закрылки {LastResult} секунд</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>mode</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</then>
<else>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>result = {var.mode} - {1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>Закрываем закрылки {LastResult} секунд</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.SetVar</cmdType>
<params>
<param>mode</param>
<param>{1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</else>
</if>
<phrase>Закрылки</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\flightsim.xml</payloadFromXML>
</command>
</commandGroup>

В папку payloads надо будет сунуть прилагаемый файл. Саму логику удержания клавиш не делал, ограничился подсчётом необходимых секунд и определением направления движения закрылок. И да, понятное дело, это работает, если клавиатуру для управления закрылками не использовать вообще. В противном случае нужно как-то отлавливать удержание клавиш, возможно, поможет что-то типа Eventghost.

You should also put the attached file in your "payloads" directory. I didn't implement the key pressing itself, this command just prints the direction of flaps and the number of seconds that key needs to be pressed. And yes, this works only if you don't use your keyboard to control flaps at the same time. Otherwise, you need to track keys holding. Maybe, something like Eventghost can help.
« Last Edit: February 01, 2015, 03:24:21 PM by Phobophile »

Phobophile

  • Jr. Member
  • **
  • Posts: 36
  • Karma: 7
    • View Profile
    • Facebook
Re: Checking pressing
« Reply #43 on: February 01, 2015, 03:27:06 PM »
When you start VoxCommando the variable has no value.  The way you created your logic block, both commands will fail because the variable is not equal to either 0 or 1.
By the way, is there any way to initialize the variable when VoxCommando starts? Or to check if it was initialized, something like "IsNull"?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Checking pressing
« Reply #44 on: February 01, 2015, 05:47:02 PM »
Yes, the VC.Loaded event is what we normally use for initializing stuff.