Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: Mouse inputs Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: April 24 2004 at 23:45 | IP Logged Quote johnsde

Does anyone know how to use mouse inputs. Would like to be able to use/program the two buttons on the mouse

 

johnsde

 

Back to Top View johnsde's Profile Search for other posts by johnsde
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 26 2004 at 09:34 | IP Logged Quote dhoward

John,

Could you provide a little more info?  Are you trying to use/program the mouse buttons in relation to PowerHome or just in general?

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: April 26 2004 at 15:04 | IP Logged Quote johnsde

I want to use just the two mouse buttons or two inputs  to to control powerhome.

My son has to run the computer with his mouth through a sip and puff switch and mouse and he is fine when hes in his wheel chair. When laying in bed is where I want to use PH as he can't use a mouse just a sip and touch switch (two inputs). Now he uses a uneversal remote Iv'ehard wired with the basic stamp for the scanning(about 30 options)

Back to Top View johnsde's Profile Search for other posts by johnsde
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 27 2004 at 13:27 | IP Logged Quote dhoward

John,

Forgive me for my ignorance concerning the "sip and puff switch".  Im envisioning a device with a tube that basically controls two switches which is designed to simultate mouse presses when hooked to a computer.  Essentially you would get a left click when blowing or puffing and a right click when drawing or sipping.  Is this close?  If so, does the device have the resolution to simulate a double-click by double-puffing?

It sounds as if this device only has the means to simulate the mouse clicks and can in no way move the mouse pointer limiting your input ability to just two or possible three combinations (left click, right click, left double click).

If all of the above is correct, PowerHome does not include any functionality that could easily be controlled in this manner.  Now you say you've got a universal remote that you've hooked to PowerHome somehow to achieve roughly 30 different commands.  Ive done something similar using a standard X-10 palm pad remote (16 buttons plus 2 buttons for dim and bright) whose signals are picked up by a W800RF32A X-10 RF receiver.  With the proper PowerHome programming, I essentially have 256 possible options by always pressing combinations of two buttons.  Ive put together special macros that really allow me to "push the limits" of this little RF transmitter.  The biggest problem being trying to remember all possible combinations of buttons that Ive programmed for.

Now back to your original question...If you're limited to two or three input possibilites, it may be possible to write a "helper" application that would work off of a user-defined INI file to create menus and actions.  What Im thinking of is an application that presents a main menu.  Puffing would move the current highlight to cycle through all possible menu items.  Drawing would select a menu item.  Selecting a menu item would either bring up a new menu or result in a direct action.  This "helper" app would then send the appropriate "command" to PowerHome using either Windows messaging or Sockets.  Is this similar to what you had in mind?

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 27 2004 at 13:53 | IP Logged Quote dhoward

John,

I did a search and read all of your previous posts and think Ive picked up on what you want to do.  It would appear that you will have a Control Center tab with a number of buttons with each button having its color cycled a half second apart.  When the desired action is highlighted (a color change), a sip or puff would then trigger the currently highlighted button.  

If this is the case...I can't think of a good, clean way for PowerHome to recognize the mouse click.  PowerHome is only currently designed to handle respond to the mouse click when the pointer is over a button.  But....that means that we could have a single large button that essentially covers the entire Control Center with the cycling color buttons placed on top.  As long as the mouse pointer was not directly on top of one of the other buttons, you could make the action of this background button to be to check the global variable that tracks the currently highlighted button and then perform its action.  Another possibility would again be a "helper" application that sits in the foreground and as soon as a "mouse input" occurs, send a message to PowerHome which will in turn fire a trigger whose action checks the global variable and then performs the appropriate action, etc.

However...you would have to change the code from your earlier post for cycling the colors.  You had:

ph_setccbtnbcolor( 1, 1, 230 )+ph_delay( 500 )+ph_setccbtnbcolor(1,1,12632256)+ph_delay(500)+ph_setccbtnbcolor(1,ph_getglobal_n ( "butt" ),230)+ph_addtovar ( 3,("butt"), 1)

or similar.  The main problem here is that the ph_delay function will indeed delay for half a second, but would not allow PowerHome to respond to any button clicks or messages for helper apps or similar.  You would want to recode this in a macro with the delay portion appearing on its own line as a "Wait" command for .5 seconds.  The "Wait" command will also delay for half a second but WILL allow other macros, triggers, and processing to occur while the macro is "Waiting".  The delay command or function does not allow this.

Let me know if Im at least heading in the right direction and what I can do to help.

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: April 27 2004 at 17:23 | IP Logged Quote johnsde

Dave

You have the sip and puff switch about right. I take a pressure switch and a vacumn switch an attach with a "T" and hard wire to the mouse switches with a joystick setup for movement, usually with a wireless mouse.

Your right about what I have in mind for the program. What he has know is one switch stops and starts the cycling and the other switch selects what it stops on. He has the same problem as you with a lot of combinations to memorize. He has a excellent memory.

Are there any other inputs that I can use/steal?

I'll try the wait command

johnsde

 

 

Back to Top View johnsde's Profile Search for other posts by johnsde
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 27 2004 at 20:18 | IP Logged Quote TonyNo

Maybe you can steal some gameport or printer port bits? What OS are you using? Getting to those ports with 2000 or XP is not easy. An alternate to this would be to use USB with one of those do-it-yourself USB chips.

Let us know if you need more help. I love assistance-apps like this.

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: April 28 2004 at 09:42 | IP Logged Quote johnsde

Thanks for the help you guys are great.

Never heard of do-it-yourself USB chips, do you have a source for them and some info?

 Allso whats the correct format for the "wait" command, all I saw in the documentation is how to modify the wait command?

johnsde

Back to Top View johnsde's Profile Search for other posts by johnsde
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 28 2004 at 20:55 | IP Logged Quote TonyNo

The USB chips come from Delcom Engineering...

http://www.delcom-eng.com/products_USBIO.asp#DemoBrd

Nifty stuff!

The Wait command has one parameter that is the time in seconds.

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 29 2004 at 15:09 | IP Logged Quote dhoward

 

John,

Im not sure what other inputs you could really use for triggers.  PowerHome will respond to mouse and keyboard input, but it is usually context sensitive...in the case of the mouse, it depends upon where the pointer is...in the case of the keyboard, it depends upon the current screen.

One possibility is capturing the keyboard input and using the programmable menu macro commands.  Under the Macro menu, you will see a section with 48 user defined hot keyable macros.  You could pick a couple and have them fed by the sip and puff switch to control the cycling and selection of CC buttons.  These macros and keystrokes would accesible regardless of what screen was up (PowerHome would have to be the active application however).  You could either hack an existing keyboard to wire in the S&P switch or you could buy a dedicated keyboard controller such as those designed for MAME (Multiple Arcade Machine Emulator).  These dedicated controllers are designed to work inline with a standard keyboard (or standalone) and have terminal blocks for hardwiring switches.  They are also programmable so you can choose the keystrokes that are sent when a switch contact is made.  These would also make a handy relatively cheap way to implement a digital input controller for PowerHome.  A good place to start research on this path would be http://www.mameroom.com.  A direct link to a sample dedicated keyboard controller would be http://www.ultimarc.com/ipac1.html.

Another way to interface the S&P switch and not be reliant upon the current PowerHome screen, etc. would be to use one of the standard controllers that PowerHome supports.  You could wire directly to a SECU-16 digital I/O module with Ocelot or directly hack into a palm pad or keychain remote and trigger X-10.  This X-10 could then fire PowerHome triggers which will respond accordingly.

Im also going to make a couple of additions to PowerHome that I believe will make what you're attempting to do a little easier...very generic such as being able to select if a background button or foreground button takes precedence in the Control Center and a reverse lookup function that will return the CC button if you have only the tab and the key.

Dave.

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 29 2004 at 19:27 | IP Logged Quote TonyNo

Reading Dave's post reminded me that there are boxes out there that you can connect switches to and then connect that to a keyboard port. It makes the switches look like keyboard keys.
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 29 2004 at 20:10 | IP Logged Quote TonyNo

You know, with keyboards available for $10 or less, it would be better to just get one and wire up switches to a few keys!
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: April 30 2004 at 11:58 | IP Logged Quote johnsde

Thanks for all the information Ill be looking at it when I start on the hardware part of the project. One of my considerations is that it can't be over dependent on my being there for upkeep so I want to keep the modifications to hardware to a minimum even though its what I'am good at.

Need help with the "WAIT" command can't get it to work and can't find an example to look at in the sample program. Can you tell me what I have to do to use the wait command instead of the delay.

ph_setccbtnbcolor( 1, 1, 230 )+ph_delay( 500 )+ph_setccbtnbcolor(1,1,12632256)+ph_delay(500)+ph_setccbtnbcolor(1,ph_getglobal_n ( "butt" ),230)+ph_addtovar ( 3,("butt"), 1)

johnsde

Back to Top View johnsde's Profile Search for other posts by johnsde
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 30 2004 at 12:42 | IP Logged Quote TonyNo

AFAIK, Wait is a command that has no equivalent outside of a macro. Try converting that into a macro. You could do the ph_ commands as a formula, then, add the Wait...

Formula  ph_setccbtnbcolor(...)

Wait  1

Formula  ph_setccbtnbcolor(...)

etc.

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 30 2004 at 14:09 | IP Logged Quote dhoward

John,

Tony's correct...the "Wait" command is only available within a macro.  Use the "Formula" command from within a macro to do your btncolor, then a command to "Wait" (you can use .5 seconds), then another line for the next ccbtncolor, and so on.  Just quickly looking over your formula above, you should be able to do it in 5 macro lines.

Check out Tony's post as it probably makes more sense than mine .

Dave.

 

Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: April 30 2004 at 17:52 | IP Logged Quote TonyNo

Cool! I didn't realize that you could use non-integers for Wait!

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: May 03 2004 at 00:41 | IP Logged Quote johnsde

                                                     

Still trying the wait command can you tell me what I'am doing wrong.

ph_setccbtnbcolor(2,ph_getglobal_n(“BUTT”),230)

wait 5     does not work here but +ph_delay(500) does      

+ph_setccbtnbcolor(2,ph_getglobal_n(“BUTT”),12632256)

+ph_delay(500)

+ph_setglobal_a(“BUTT”,ph_getglobal_n(“BUTT”)+1)

+ph_setglobal_a(“BUTT”,if (ph_getglobal_n(“BUTT”)> ph_getglobal_n(“BUTT”)))

+ph_macro(“CALLZ”)

 

callz just starts it over                                              

 

 

 

Back to Top View johnsde's Profile Search for other posts by johnsde
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: May 03 2004 at 07:52 | IP Logged Quote TonyNo

Delay is in milliseconds, and, wait is in seconds, so, if you use a delay of 500, the wait would be 0.5. Also, try putting quotes around the wait value...

Wait "0.5"

Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
johnsde
Newbie
Newbie
Avatar

Joined: April 01 2004
Location: United States
Online Status: Offline
Posts: 17
Posted: May 03 2004 at 20:21 | IP Logged Quote johnsde

Still having problems with the WAIT command

Any chance that my computer can't do the WAIT command I haven't  been able to do any Windows script only Formulas Functions.

johnsde       

Back to Top View johnsde's Profile Search for other posts by johnsde
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: May 03 2004 at 20:43 | IP Logged Quote TonyNo

You do have that in a macro, right?
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 

Page of 2 Next >>
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum