CursorOn Disables Mouse-Bound Controls
by Scott Doerrfeld · in Torque Game Engine · 09/20/2007 (2:27 pm) · 7 replies
When I have the cursor on in-game it no longer responds to any mouse controls I have set in default.bind.cs (i.e. moveMap.bind(mouse0, "button0", moveForward); will be disabled when the cursor is on.) Where is this happening in the engine?
About the author
#2
U mean that in playgui.gui u've set noCursor = false (or 0) & the mouse isn't working right or not working @ all??
& are u sure that the binding is also in config.cs too ?? its a common mistake that ppl dont make sure tha the binding is in that file too, u can just delete it & it will be recreated with all the updates !!
09/21/2007 (5:17 pm)
Hello scottU mean that in playgui.gui u've set noCursor = false (or 0) & the mouse isn't working right or not working @ all??
& are u sure that the binding is also in config.cs too ?? its a common mistake that ppl dont make sure tha the binding is in that file too, u can just delete it & it will be recreated with all the updates !!
#3
09/22/2007 (12:56 pm)
No I am just talking about how the engine is meant to work where if the cursor is turned on it responds to mouse events differently. Basically it looks at what GUIs you are clicking on instead of using the controls you have set up in the Action Map. I was wondering if I could change it to maybe respond to both??
#4
To be clear, the following is a multiple bind.
movemap.bindcommand(keyboard , "n" , "" , "NetGraph::toggleNetGraph();");
movemap.bindcommand(keyboard , "m" , "" , "NetGraph::toggleNetGraph();");
This Will only bind toggleNetGraph function to the N key "
This is taken from "The Game Programmer's Guide to Torque"
I suppose that it answers ur question :)
09/22/2007 (11:48 pm)
" It should be noted that Binding more than one key to the same action (using the same action map) is not Allowed, TGE will do its best to preempt this kind of assignment. Normally, if one attempts to bind 2 inputs to the same response, the second binding will silently fail. However, this behavior is not consistent. So, it is best to be aware of this and to check your action maps for duplicate assignments.To be clear, the following is a multiple bind.
movemap.bindcommand(keyboard , "n" , "" , "NetGraph::toggleNetGraph();");
movemap.bindcommand(keyboard , "m" , "" , "NetGraph::toggleNetGraph();");
This Will only bind toggleNetGraph function to the N key "
This is taken from "The Game Programmer's Guide to Torque"
I suppose that it answers ur question :)
#5
He's talking about something different. The problem is that when a GUI comes into focus it overrides any assigned mouse inputs so that one can use the mouse to navigate said GUI.
Scott, there is a solution to this problem and it's quite simple. There are various posts on these forums that discuss solutions and provide working code, I can't remember where they are so you'll need to conduct a search.
09/23/2007 (12:21 am)
That doesn't answer his question at all :)He's talking about something different. The problem is that when a GUI comes into focus it overrides any assigned mouse inputs so that one can use the mouse to navigate said GUI.
Scott, there is a solution to this problem and it's quite simple. There are various posts on these forums that discuss solutions and provide working code, I can't remember where they are so you'll need to conduct a search.
#6
I know it says it's for TGEA however it should still work in TGE - there aren't any major differences between the two engines regarding GUI code.
09/23/2007 (12:29 am)
Just found something, see if this helps: Allowing mouse input to trigger key bindings while the cursor is on (TGEA).I know it says it's for TGEA however it should still work in TGE - there aren't any major differences between the two engines regarding GUI code.
#7
seems that I'm kinda thick headed those days :D :D
I apologize for the misunderstanding :)
09/23/2007 (12:45 am)
Oh sry abt thatseems that I'm kinda thick headed those days :D :D
I apologize for the misunderstanding :)
Torque Owner Scott Doerrfeld