Input Event

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 05/04/2003 at 06:23, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.100 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
How can I retrieve a single input event outside a mouse movement in a tool plugin?
if (GetInputState(BFM_INPUT_KEYBOARD,KEY_SHIFT,res)) does only work when the mouse is moved. I need to know if the user pushes the Shift button only!
Thanks

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2003 at 12:32, xxxxxxxx wrote:

Can't you use the the BFM_INPUT_MOUSE channel and look for the SHIFT qualifier in the result? (See another thread.)

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 11/04/2003 at 16:53, xxxxxxxx wrote:

As I said, I don´t want a mouse movement for the detection. I just want to detect if the user pushes the SHIFT or ESC key without any mouse movement.
Any chance?
Thanks

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 01:37, xxxxxxxx wrote:

Hi Samir,
The 'GetInputState()' tells you the current _state_ of the input, so it doesn't matter whether the mouse is moving or not. It's _not_ informing you of an event. I'm using the following code (provided by Mikael) to read shift and ctrl in a tool plugin, and it seems to work fine:

  
GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT, state);  
     Bool bShift = (state.GetLong(BFM_INPUT_QUALIFIER) & QSHIFT) != 0;  
     Bool bCtrl = (state.GetLong(BFM_INPUT_QUALIFIER) & QCTRL) != 0;  

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 01:43, xxxxxxxx wrote:

Just as a quick hack - I tried the following, and it does correctly echo the current state of the Ctrl,Shift keys to the console, whether you touch the mouse or not.

cheers - Steve

  
Bool bShift, bCtrl;  
while(1) {  
      GetInputState(BFM_INPUT_MOUSE,BFM_INPUT_MOUSELEFT, state);  
     bShift = (state.GetLong(BFM_INPUT_QUALIFIER) & QSHIFT) != 0;  
     bCtrl = (state.GetLong(BFM_INPUT_QUALIFIER) & QCTRL) != 0;  
     GePrint("shift: " + LongToString(bShift) + " ctrl: " +LongToString(bCtrl));  
}  

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 02:26, xxxxxxxx wrote:

Sorry, that doesn´t work for me unless I use the mouse. I don´t want to use the mouse. No clicking, no moving, just simply the shift key. :\ I seem to forgot to say that I also don´t want it outside a mouseclick. Sorry, my fault. Thanks anyway, though the code was known...
Does anybody know?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 10:49, xxxxxxxx wrote:

Hmm, I'm a bit puzzled. The 'hack' code above works on my system without me touching the mouse - just the shift/ctrl keys...

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 14:01, xxxxxxxx wrote:

maybe this works:
GetInputState(BFM_INPUT_KEYBOARD, 'A', inputdata);
qualifier=inputdata.GetLong(BFM_INPUT_QUALIFIER);

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/04/2003 at 14:58, xxxxxxxx wrote:

Hi Klaus,
thank you, I will try that tommorrow. One of those has to work I guess :)
@Steve: Thanks anyway for your help!

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/04/2003 at 13:07, xxxxxxxx wrote:

I am guessing the reason it does not work is because you are trying to do so within a plugin tool ( one of those cool widgets possibly? ). The issue here as that none of those functions are called unless the mouse moves.

darf

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 14/04/2003 at 15:30, xxxxxxxx wrote:

yes, it appears to be so. :( It doesn´t work for me.
Well, thanks anyway to all of you.
Best
Samir