public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Herron <David.Herron@Sun.COM>
To: Lillian Angel <langel@redhat.com>
Cc: "Steve McKay☄" <smckay@google.com>, mauve-discuss@sources.redhat.com
Subject: Re: Tweaking default java.awt.Robot settings
Date: Tue, 25 Sep 2007 19:27:00 -0000	[thread overview]
Message-ID: <46F96193.7080202@sun.com> (raw)
In-Reply-To: <46F95489.3080101@redhat.com>

Lillian Angel wrote:
> David Herron wrote:
>> [resending because the mailing list thingy told me I had to use only 
>> plain text messages...]
>>
>> Hmmm.. here's the meat of the test
>>
>>  public void runTest(int code, char chr)
>>  {
>>    KeyEvent e = new KeyEvent(f, KeyEvent.KEY_PRESSED, 0, 0, code, 
>> chr, KeyEvent.KEY_LOCATION_STANDARD);
>>    f.dispatchEvent(e);
>>        f.setSize(200,200);
>>    f.show();
>>    r.mouseMove(60, 60);
>>
>>    r.keyPress(code);
>>    r.keyRelease(code);
>>    h.check(key, (int) chr);
>>  }
>>
>> I don't understand this.  If you're going to create a Java event why 
>> use Robot, or vice versa...?
>
> The test was done this way to determine if the right key was pressed. 
> See the inner class (myFrame) which has 1 function (keyDown) which 
> sets a variable (key) to the key that was pressed.
>
> While it might be incorrect, I am unsure how else we can determine 
> that the correct key was pressed without dispatching an event.
>
> Lillian
>

Maybe I misread the code in my brief look.

The side effect of using Robot to keyPress and keyRelease should be the 
dispatch of two KeyEvent's.  That's why I said those two lines should 
go, because the way I read it they're masking whether Robot successfully 
delivered the KeyEvent's.


- David Herron

  parent reply	other threads:[~2007-09-25 19:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 20:31 Steve McKay☄
2007-09-24 20:50 ` David Herron
2007-09-24 21:22   ` Steve McKay☄
2007-09-24 21:41     ` David Herron
2007-09-25 18:33       ` Lillian Angel
2007-09-25 19:13         ` Steve McKay☄
2007-09-25 19:27           ` Lillian Angel
2007-09-25 19:37             ` Steve McKay☄
2007-09-25 19:45               ` Lillian Angel
2007-09-25 19:27         ` David Herron [this message]
2007-09-25 18:33   ` Thomas Fitzsimmons
2007-09-25 18:57     ` Steve McKay☄
2007-09-25 19:58       ` Thomas Fitzsimmons
2007-09-25 20:28         ` Steve McKay☄
2007-10-04  0:43           ` Steve McKay☄
2007-10-04 13:04             ` Lillian Angel
2007-09-25 19:24     ` David Herron
2007-09-25 18:10 ` Thomas Fitzsimmons
2007-09-25 18:14   ` Steve McKay☄

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F96193.7080202@sun.com \
    --to=david.herron@sun.com \
    --cc=langel@redhat.com \
    --cc=mauve-discuss@sources.redhat.com \
    --cc=smckay@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).