Author Topic: Opening windows at an absolute size & position  (Read 6050 times)

0 Members and 2 Guests are viewing this topic.

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Opening windows at an absolute size & position
« on: October 05, 2014, 10:54:15 AM »
Ok , new question . (I only resort to asking when I can't find the answer here) , I'm creating an interactive chess program , where moves are made and spoken by vox . Since I can't make mouse clicks relative to the active window , I need to make sure my chess window always opens in the same position and size : left: 838     top: 33     width: 800     height: 600 . Is there a command for setting this ?   And can I create a trigger that triggers any time the clipboard contents changes ?
dan

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Opening windows at an absolute size & position
« Reply #1 on: October 05, 2014, 11:10:26 AM »
I can give you the answer how you can set the size and position of any program window  ;)

http://winsize2.sourceforge.net/en/index.html

maybe it helps   ;)
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Opening windows at an absolute size & position
« Reply #2 on: October 05, 2014, 11:31:27 AM »
And can I create a trigger that triggers any time the clipboard contents changes ?

You can set information to the clipboard and get information from the clipboard using VC actions , and in those cases you would know when the contents are changing and could use an action to trigger an event accordingly.

If you're not using VC for that task then I don't think so. James might know otherwise.
 
Can you provide more context for why you need to trigger events when clipboard contents change, and what is causing the contents to change? There may be other solutions.
« Last Edit: October 05, 2014, 11:34:21 AM by nime5ter »
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)

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #3 on: October 05, 2014, 11:54:50 AM »
Yes , In my chess program , each move is placed on the clipboard as a new move , replacing the last move , each time a new move has been placed on the clipboard , I want to trigger tts voice to announce the move , so the tts voice needs to know when a new entry has been made to the clipboard .
dan

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #4 on: October 05, 2014, 12:01:22 PM »
I can give you the answer how you can set the size and position of any program window  ;)

http://winsize2.sourceforge.net/en/index.html

maybe it helps   ;)


Thank you Kalle for the link to winsize , and I might use this . I can also do this with a simple little autohotkey script . But I just wondered if vox had it's own way to do this.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7712
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Opening windows at an absolute size & position
« Reply #5 on: October 05, 2014, 12:13:05 PM »
Yes , In my chess program , each move is placed on the clipboard as a new move , replacing the last move , each time a new move has been placed on the clipboard , I want to trigger tts voice to announce the move , so the tts voice needs to know when a new entry has been made to the clipboard .
dan

If you are actually writing the program yourself, then I suggest you either generate the TTS directly in your program, or send messages to VC using UDP api messages.

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #6 on: October 05, 2014, 12:15:51 PM »
I'm not writing the program ,I'm not that good! I already have a chess program that telegraphs it's moves via the clipboard , it's called chess by chat

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #7 on: October 05, 2014, 12:39:11 PM »
Right now my workaround is to have an autohotkey script monitor my clipboard and when it detects a change , it does a keypress (spacebar) which vox can detect using the keyboard hook plug-in . I just thought there might be a better way within vox

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #8 on: October 05, 2014, 01:07:59 PM »
If you do a google search, you will find a lot of info about monitoring the clipboard and also some free software  ;)

http://clipdiary.com/faq-all-about-clipboard-monitoring.php

http://www.nonags.com/nonags/clipb.html

If you are able to store each clipboard content automatically to a specific folder then you can use the VC-Watcher plugin for monitoring this folder.  ;)

http://voxcommando.com/mediawiki/index.php?title=Plugin_List#Watcher
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Opening windows at an absolute size & position
« Reply #9 on: October 05, 2014, 01:41:06 PM »
If you're already using autohotkey, that's probably about as easy as anything else.

Currently VC doesn't automatically generate an event when clipboard content changes.

There would be a couple ways to do it within VC with a bit of creativity (e.g., whenever you're playing a chess game have VC regularly check the clipboard to see if its content changes -- if yes, it tells you the new content). But that probably would be better if it happened in its own thread, and that would mean a python-plugin solution rather than a simple VC command. Since you don't program, autohotkey is a reasonable alternative.
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)

danderson

  • Jr. Member
  • **
  • Posts: 38
  • Karma: 0
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #10 on: October 05, 2014, 02:25:58 PM »
Ok, I you are probable right , I have it working with 6 little lines of script in autohotkey . That's one program I am very familiar with .
And I decided to go with winsize2 for maintaining my window size and position . Thank you Kalle for that , I noticed in the manual the author Kalle Koseck , is that you?

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #11 on: October 05, 2014, 03:35:58 PM »
If you have AH script monitoring clipboard then just trigger an event in VC using


Triggering Events (from wiki)
VoxCommando.exe -33000 "VC.TriggerEvent&&MyEvent.On&&I am Payload 1&&and I am Payload 2"

Like this you can even pass the contents of clipboard as payload to your event
Your command then can place VC in on.single to wait for your next move
When Voice command gets tough, use hand gestures

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Opening windows at an absolute size & position
« Reply #12 on: October 05, 2014, 03:40:18 PM »
Haha, no I'm not the author but funny, because "Kalle" is the short name from Karlheinz  ;)
***********  get excited and make things  **********

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Opening windows at an absolute size & position
« Reply #13 on: October 05, 2014, 06:15:15 PM »
If you have AH script monitoring clipboard then just trigger an event in VC using


Triggering Events (from wiki)
VoxCommando.exe -33000 "VC.TriggerEvent&&MyEvent.On&&I am Payload 1&&and I am Payload 2"

Like this you can even pass the contents of clipboard as payload to your event
Your command then can place VC in on.single to wait for your next move


@Haddood -- I don't use AH, so I apologize if this is a stupid question. If he can do that from an AH script, why wouldn't he just have AH send a TTS action directly? Why trigger an event?

i.e.
Code: [Select]
VoxCommando.exe -33000 "TTS.Speak&&E2 to E3"http://voxcommando.com/mediawiki/index.php?title=Command_line#Perform_Actions
« Last Edit: October 05, 2014, 06:17:28 PM by nime5ter »
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: 7712
  • Karma: 116
    • View Profile
    • VoxCommando