VW7.3.1 windows XP, shiftDown problem ...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

VW7.3.1 windows XP, shiftDown problem ...

Dennis smith-4
I am trying to test for shiftDown.  My code is

    someWindow sensor shiftDown

This works 100% of the time -- except yesterday and today on one
developers laptop,
on which it has worked all the time before.

Now if I trace the results, it tests 3 times following the press of a
specific button,
2 get false, the 3rd gets true (shift IS down).

However, if I connect to his PC using a RAdmin (a remote access thingy),
it works perfectly
when "I" hold down shift on MY PC.

Anyone seen anything like this before??

--
Dennis Smith                        [hidden email]
Cherniak Software Development Corporation       +1 905.771.7011
400-10 Commerce Valley Dr E                Fax: +1 905.771.6288
Thornhill, ON Canada L3T 7N7    http://www.CherniakSoftware.com

Reply | Threaded
Open this post in threaded view
|

Re: VW7.3.1 windows XP, shiftDown problem ...

Reinout Heeck-2
Dennis Smith wrote:

> I am trying to test for shiftDown.  My code is
>
>    someWindow sensor shiftDown
>
> This works 100% of the time -- except yesterday and today on one
> developers laptop,
> on which it has worked all the time before.
>
> Now if I trace the results, it tests 3 times following the press of a
> specific button,
> 2 get false, the 3rd gets true (shift IS down).
>
> However, if I connect to his PC using a RAdmin (a remote access thingy),
> it works perfectly
> when "I" hold down shift on MY PC.
>
> Anyone seen anything like this before??
>



This is a well-known multithreading bug: The Views that make up your
application get queued Events which do not record the state of the
various shift keys, so if you received such an event and then ask the
sensor (which delegates to InputState default) for the state of the
shift key at a later time this may be off by several queued messages.
Such queued messages could be exposure events or other events being sent
to any of your windows by the OS (or even by another application).

Having said all this I've never run into this problem except:
1) when debugging application code that does such a test
2) when releasing the shift key (during a long-running operation) before
the #shiftDown is executed.


R
-

Reply | Threaded
Open this post in threaded view
|

Re: VW7.3.1 windows XP, shiftDown problem ...

Dennis smith-4


Reinout Heeck wrote:

> Dennis Smith wrote:
>> I am trying to test for shiftDown.  My code is
>>
>>    someWindow sensor shiftDown
>>
>> This works 100% of the time -- except yesterday and today on one
>> developers laptop,
>> on which it has worked all the time before.
>>
>> Now if I trace the results, it tests 3 times following the press of a
>> specific button,
>> 2 get false, the 3rd gets true (shift IS down).
>>
>> However, if I connect to his PC using a RAdmin (a remote access
>> thingy), it works perfectly
>> when "I" hold down shift on MY PC.
>>
>> Anyone seen anything like this before??
>>
>
>
None of this would surprise me -- what does surprise me is that we have
been doing this for
a few years with quite a number of different PCs and laptops (including
this one), and this is the first
time we have had a problem, and the problem is repeatable -- on that
machine only.

However, thinking more about it -- I will bet we have a problem with the
GUI processes (window processes)
because also on that laptop pressing buttons (on a window) seems to miss
presses sometimes -- and I have seen
this before -- my dirty solution being to rebuild the image from our
base image (via store).


>
> This is a well-known multithreading bug: The Views that make up your
> application get queued Events which do not record the state of the
> various shift keys, so if you received such an event and then ask the
> sensor (which delegates to InputState default) for the state of the
> shift key at a later time this may be off by several queued messages.
> Such queued messages could be exposure events or other events being sent
> to any of your windows by the OS (or even by another application).
>
> Having said all this I've never run into this problem except:
> 1) when debugging application code that does such a test
> 2) when releasing the shift key (during a long-running operation) before
> the #shiftDown is executed.
>
>
> R
> -
>

--
Dennis Smith                        [hidden email]
Cherniak Software Development Corporation       +1 905.771.7011
400-10 Commerce Valley Dr E                Fax: +1 905.771.6288
Thornhill, ON Canada L3T 7N7    http://www.CherniakSoftware.com

Reply | Threaded
Open this post in threaded view
|

RE: VW7.3.1 windows XP, shiftDown problem ...

Terry Raymond
Dennis

Is this a development image?

If so, open the ProcessMonitor and see if you have any
garbage processes. For some reason I have been seeing
what are essentially zombie processes that tend to suck
up CPU and they make the UI run slowly.

Also, as Reinout pointed out that accessing the shift
state is multithreading problem. This is also true of accessing
mousePoint. We need some other way of storing mouse point
and shift state in the window. This is necessary so the
values are synchronous with the event processing.

Terry
 
===========================================================
Terry Raymond       Smalltalk Professional Debug Package
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Dennis Smith [mailto:[hidden email]]
> Sent: Wednesday, May 03, 2006 11:53 AM
> To: Reinout Heeck
> Cc: VWNC,
> Subject: Re: VW7.3.1 windows XP, shiftDown problem ...
>
>
>
> Reinout Heeck wrote:
> > Dennis Smith wrote:
> >> I am trying to test for shiftDown.  My code is
> >>
> >>    someWindow sensor shiftDown
> >>
> >> This works 100% of the time -- except yesterday and today on one
> >> developers laptop,
> >> on which it has worked all the time before.
> >>
> >> Now if I trace the results, it tests 3 times following the press of a
> >> specific button,
> >> 2 get false, the 3rd gets true (shift IS down).
> >>
> >> However, if I connect to his PC using a RAdmin (a remote access
> >> thingy), it works perfectly
> >> when "I" hold down shift on MY PC.
> >>
> >> Anyone seen anything like this before??
> >>
> >
> >
> None of this would surprise me -- what does surprise me is that we have
> been doing this for
> a few years with quite a number of different PCs and laptops (including
> this one), and this is the first
> time we have had a problem, and the problem is repeatable -- on that
> machine only.
>
> However, thinking more about it -- I will bet we have a problem with the
> GUI processes (window processes)
> because also on that laptop pressing buttons (on a window) seems to miss
> presses sometimes -- and I have seen
> this before -- my dirty solution being to rebuild the image from our
> base image (via store).
>
>
> >
> > This is a well-known multithreading bug: The Views that make up your
> > application get queued Events which do not record the state of the
> > various shift keys, so if you received such an event and then ask the
> > sensor (which delegates to InputState default) for the state of the
> > shift key at a later time this may be off by several queued messages.
> > Such queued messages could be exposure events or other events being sent
> > to any of your windows by the OS (or even by another application).
> >
> > Having said all this I've never run into this problem except:
> > 1) when debugging application code that does such a test
> > 2) when releasing the shift key (during a long-running operation) before
> > the #shiftDown is executed.
> >
> >
> > R
> > -
> >
>
> --
> Dennis Smith                        [hidden email]
> Cherniak Software Development Corporation       +1 905.771.7011
> 400-10 Commerce Valley Dr E                Fax: +1 905.771.6288
> Thornhill, ON Canada L3T 7N7    http://www.CherniakSoftware.com

Reply | Threaded
Open this post in threaded view
|

Re: VW7.3.1 windows XP, shiftDown problem ...

Mark Pirogovsky-3
In reply to this post by Dennis smith-4
Hello all,

You want to get the information from the "horses mouth"...
I found it most reliable to ask the "InputState default" for the state
of the keyboard, while the window sensor lives few message sends away
from the INputState.

My 2c.

--mark


Dennis Smith wrote:

> I am trying to test for shiftDown.  My code is
>
>    someWindow sensor shiftDown
>
> This works 100% of the time -- except yesterday and today on one
> developers laptop,
> on which it has worked all the time before.
>
> Now if I trace the results, it tests 3 times following the press of a
> specific button,
> 2 get false, the 3rd gets true (shift IS down).
>
> However, if I connect to his PC using a RAdmin (a remote access thingy),
> it works perfectly
> when "I" hold down shift on MY PC.
>
> Anyone seen anything like this before??
>