Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Capturing the state of keyboard modifiers on startup

Thread view: 
Aleksey Gureev - 07 Mar 2007 17:34 GMT
Hi Nutcrackers!

Here's one interesting problem for you. I need to check the state of
the modifiers during the startup sequence of the application to see if
some special action should be taken. Imagine holding CTRL for the
complete database reset and ALT to call the configuration wizard. The
check is supposed to be performed right after the splash screen comes
up (Swing is initialized).

The question is if there is a place (hidden?) where the present
keyboard modifiers state is held and could be queried? One way I
imagine is to add a key listener code to the splash screen, but it's a
kludge in my view.

Any bright ideas?

Thanks,

-- Aleksey
Jason Cavett - 07 Mar 2007 18:05 GMT
> Hi Nutcrackers!
>
[quoted text clipped - 15 lines]
>
> -- Aleksey

So a specific "program" runs depends on keys that are being pressed
upon startup?  That's kind of confusing IMO.

Since you want a configuration wizard (something in options, perhaps)
and a reset (a button on the screen) - it just sounds like you want
things that could be a part of the larger application.

I could be wrong, of course, becuase I don't know exactly what your
application is doing, but I'd suggest rethinking how the user will
access different components of your interface.  (At the very least, I
wouldn't recommend the use of keys - maybe the user should pass
options via the commandline.)
Joe Attardi - 07 Mar 2007 23:04 GMT
> Imagine holding CTRL for the
> complete database reset and ALT to call the configuration wizard.

Do you hate your users, or something?
Seriously though - that is not at all user friendly. How about
automatically running the configuration wizard the first time the
program is run, and after that it can just be accessed via a menu
item? A database reset should definitely be a menu item, not triggered
by a hotkey.

Just my $0.02

Joe
Aleksey Gureev - 08 Mar 2007 10:01 GMT
Guys,

Very helpful so far! Is it a usability forum or something?

> Do you hate your users, or something?
> Seriously though - that is not at all user friendly.

It shouldn't because it's a service function that I, as a developer
and supporter, need to help a user in trouble to recover in a
relatively easy way instead of telling something, like "go to that
hidden folder in your home directory that Microsoft placed god knows
where and remove that file". sh.t happens and we need some "easter
eggs" to help ourselves.

> How about automatically running the configuration wizard the first time the
> program is run, and after that it can just be accessed via a menu
> item? A database reset should definitely be a menu item, not triggered
> by a hotkey.

The configuration wizard does run during the initial installation. I
need to be able to re-run it at will without re-installing the
application. And resetting the database should never be a menu item
because it's something the user shouldn't bother about at all. If it
is, it's the perfect timing for the developer to start looking for
another job. Sorry if I touched someone's feelings. :)

Please stop discussing the idea; it's just not worth your time. What's
of real interest is the technical side of a problem. Currently, I
can't see other way but the listener-method. It would be nice to get
access to some keyboard state information though.

Thanks,
Al
Jason Cavett - 08 Mar 2007 13:37 GMT
> Guys,
>
[quoted text clipped - 29 lines]
> Thanks,
> Al

> It shouldn't because it's a service function that I, as a developer
> and supporter, need to help a user in trouble to recover in a
> relatively easy way instead of telling something, like "go to that
> hidden folder in your home directory that Microsoft placed god knows
> where and remove that file". sh.t happens and we need some "easter
> eggs" to help ourselves.

Well...what happens if the user happens to accidentally press your
"easter egg" key and does a database reset, resulting in them losing
all their data.  (And, of course, they won't know what happened.)  You
may say that will never happen, but then you would be underestimating
what user's will try or accidentally do.  Also, purposely programming
in hidden features or an "easter egg" can really come back to bite you
later...especially if the application is not well document.

I agree with Joe here...I feel there's a more intuitive way to
implement this.

>  The configuration wizard does run during the initial installation. I
> need to be able to re-run it at will without re-installing the
> application.

Usually something like this is a trigger in a file.  When the
configuration wizard runs the first time, it sets a parameter in the
config file and makes the "run_config" value a 0 instead of a 1,
meaning "don't run the configuration wizard again."  If you need to
run it again, though, just change the value back.

> Please stop discussing the idea; it's just not worth your time.

To be fair - if you post up how you're doing something on Usenet, you
can expect people (especially technical types) to analyze what you are
doing.  With that said...

> What's of real interest is the technical side of a problem.

I honestly don't think there's a way to capture key information before
the application launches (except in your "kludge" method).  I wouldn't
put it in a splash screen, though.  Have something that checks in
between the splash screen and the actual start-up of the program to
accomplish this (just don't show the component).

Again, you may not find a lot of people who can help you with this
problem as it's not one that should/will generally be tackled due
other implementation possibilities.
Aleksey Gureev - 08 Mar 2007 15:37 GMT
Sorry for a long reply.

> > It shouldn't because it's a service function that I, as a developer
> > and supporter, need to help a user in trouble to recover in a
[quoted text clipped - 13 lines]
> I agree with Joe here...I feel there's a more intuitive way to
> implement this.

Right, it's dangerous to some extent. Hmmm

> >  The configuration wizard does run during the initial installation. I
> > need to be able to re-run it at will without re-installing the
[quoted text clipped - 5 lines]
> meaning "don't run the configuration wizard again."  If you need to
> run it again, though, just change the value back.

Yeah, but I also think how am I supposed to explain to a user-in-
trouble where to find a config file (or a key in Win registry) and how
to edit it. Another pain in the neck, I would say.

> > Please stop discussing the idea; it's just not worth your time.
>
> To be fair - if you post up how you're doing something on Usenet, you
> can expect people (especially technical types) to analyze what you are
> doing.  With that said...

I didn't mean to stop this discussion at all. Let me explain. I'm
under the strict time limits (who isn't) and if I write something to
Usenet, I know I tried everything else, Googled, performed other
research etc. So I expect people to be concise and constructive.
Instead, after a day of waiting, I get criticism with absolutely no
answers to my questions. What would be your reaction to this?
(rhetorical question)

> > What's of real interest is the technical side of a problem.
>
[quoted text clipped - 3 lines]
> between the splash screen and the actual start-up of the program to
> accomplish this (just don't show the component).

Right. I don't like it too.

> Again, you may not find a lot of people who can help you with this
> problem as it's not one that should/will generally be tackled due
> other implementation possibilities.

Yeah. Still I don't see a user-safe, developer-friendly method of
calling the list of service functions during the startup

a. without editing a file
b. without any visible GUI commands / options

The special stress is on (b) because when the DB is corrupted and I
need to reset it, the application won't start to give me any GUI with
commands / options. That's why I need something that could be invoked
during the initial startup phase.

Anyway, thanks for all bright ideas voiced and sorry if I offended
anyone! I really appreciate any help.

- Al
Jason Cavett - 08 Mar 2007 15:55 GMT
> Sorry for a long reply.
>
[quoted text clipped - 77 lines]
>
> - Show quoted text -

> (b) because when the DB is corrupted and I
> need to reset it, the application won't start to give me any GUI with
> commands / options.

Ooo...I see.  That's crummy.  So, basically, the GUI is dependent upon
the database being correct - whatever correct may be?

Another alternative - create a second "admin" program that does the
things you want it to do (and can be done in a graphical way).

Also, like I said in my original post, how hard would it be to have
the user provide command line arguments?  Not only is this already
supported (via the main method entry point), it's also very easy to
code and will be there before any GUI initialization.  Since it sounds
like what you are doing is kind of kludgy to begin with, this really
isn't any worse of an idea, and, again is pretty easy to implement.

Good luck.
Aleksey Gureev - 09 Mar 2007 08:51 GMT
> Ooo...I see.  That's crummy.  So, basically, the GUI is dependent upon
> the database being correct - whatever correct may be?

Yes, sort of.

> Another alternative - create a second "admin" program that does the
> things you want it to do (and can be done in a graphical way).

Oh. Nice shot! I've never thought about it.

> Also, like I said in my original post, how hard would it be to have
> the user provide command line arguments?  Not only is this already
> supported (via the main method entry point), it's also very easy to
> code and will be there before any GUI initialization.  Since it sounds
> like what you are doing is kind of kludgy to begin with, this really
> isn't any worse of an idea, and, again is pretty easy to implement.

The problem is that this is the WebStart application, so no command
line. :(

> Good luck.

Thanks, that idea with the helper application is very nice.

-- Al
Lew - 09 Mar 2007 04:46 GMT
> I didn't mean to stop this discussion at all. Let me explain. I'm
> under the strict time limits (who isn't) and if I write something to
[quoted text clipped - 3 lines]
> answers to my questions. What would be your reaction to this?
> (rhetorical question)

To get over it (non-rhetorical answer).

People are not here to live up to your expectations. Nor are people here to
help with your problems.

-- Lew
Aleksey Gureev - 09 Mar 2007 09:08 GMT
> > I didn't mean to stop this discussion at all. Let me explain. I'm
> > under the strict time limits (who isn't) and if I write something to
[quoted text clipped - 7 lines]
>
> People are not here to live up to your expectations.

How is that? How can I post a question and don't expect the answer?
I'm sorry, but there's a flaw in the statement. In this context I'm
afraid of giving any bits of advices, but at least respect the time of
the opponent and they'll respect yours.

> Nor are people here to help with your problems.

Then why? :) I thought it's the right place to post when you are in
trouble and expect someone share his/her wisdom. Maybe we just have
different perspectives on this?

Anyway, thanks for sharing your standpoint. Appreciated.

-- Al

P.S. I'm not going to waste any time speculating on the moral side of
the Usenet, as I'm obviously not in my field here. So, please leave it
alone. For those who still feel offended my sincere apologies.
Lew - 09 Mar 2007 14:02 GMT
>>> I didn't mean to stop this discussion at all. Let me explain. I'm
>>> under the strict time limits (who isn't) and if I write something to
[quoted text clipped - 3 lines]
>>> answers to my questions. What would be your reaction to this?
>>> (rhetorical question)

Lew wrote:
>> To get over it (non-rhetorical answer).
>>
>> People are not here to live up to your expectations.

> How is that? How can I post a question and don't expect the answer?

I'm afraid you cannot /expect/ any answer. This is a discussion group, not a
help desk. No one is obligated to answer you at all, much less how you want
them to.

> I'm sorry, but there's a flaw in the statement. In this context I'm
> afraid of giving any bits of advices, but at least respect the time of
> the opponent and they'll respect yours.

"Opponent"? What is the flaw? I aver that it is your expectation that people
are obligated to help anyone here.

>> Nor are people here to help with your problems.
>
> Then why? :) I thought it's the right place to post when you are in
> trouble and expect someone share his/her wisdom. Maybe we just have
> different perspectives on this?

It is the right place to post, just not to expect answers. Yes, the odds are
you will get answers, but many of them will be wrong or off purpose from your
point of view. By the same token, answers that may seem to be off purpose
could actually provide you with much more insight if you take the care to
understand them.

> Anyway, thanks for sharing your standpoint. Appreciated.

You are most welcome.

> P.S. I'm not going to waste any time speculating on the moral side of
> the Usenet, as I'm obviously not in my field here. So, please leave it
> alone. For those who still feel offended my sincere apologies.

This has nothing to do with morality. People aren't here to live up to my
expectations or help with my problems either. People are here to discuss the
world of Java programming, and often volunteer to help each other. It is the
expectation of any answer, much less a quick or accurate one, that is flawed.

There is a practical side. If one is impatient or demanding one may expect
much less useful responses. To go back to the original point - if one don't
like the responses one gets on Usenet, one should get over it. Just like any
other discussion, the subject will wander and people will often disagree or
get it wrong or take their time to respond or flame the group or ...

-- Lew
Joe Attardi - 08 Mar 2007 16:25 GMT
> Very helpful so far! Is it a usability forum or something?
Not primarily, but when designing an approach to solving a problem in
software, usability should always be a top concern.

> It shouldn't because it's a service function that I, as a developer
> and supporter, need to help a user in trouble to recover in a
> relatively easy way instead of telling something, like "go to that
> hidden folder in your home directory that Microsoft placed god knows
> where and remove that file".
Which is why it is the most intuitive to have an "Advanced" tab in the
configuration dialog, containing all of these things.

Also, the other approaches suggested by other posters here are also
great approaches..

- a separate admin/support utility that can be run if the database
gets trashed: Microsoft has something similar for Outlook - if a PST
file gets corrupted, there is an "Inbox Repair Tool" that you can run
that can correct errors and restore your PST file to a usable state
again.

- command-line arguments
Aleksey Gureev - 09 Mar 2007 08:54 GMT
> > Very helpful so far! Is it a usability forum or something?
>
> Not primarily, but when designing an approach to solving a problem in
> software, usability should always be a top concern.

Sure. I explained it a bit above -- it was just the wrong timing and
quite unexpected.

> > It shouldn't because it's a service function that I, as a developer
> > and supporter, need to help a user in trouble to recover in a
[quoted text clipped - 15 lines]
>
> - command-line arguments

Right, the utility application sounds like a good option. The command-
line won't work (see above).

Thanks!

-- Al


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.