Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Capturing the state of keyboard modifiers on startup

Reply
Thread Tools

Capturing the state of keyboard modifiers on startup

 
 
Aleksey Gureev
Guest
Posts: n/a
 
      03-07-2007
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

 
Reply With Quote
 
 
 
 
Jason Cavett
Guest
Posts: n/a
 
      03-07-2007
On Mar 7, 12:34 pm, "Aleksey Gureev" <(E-Mail Removed)> wrote:
> 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


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.)

 
Reply With Quote
 
 
 
 
Joe Attardi
Guest
Posts: n/a
 
      03-07-2007
On Mar 7, 12:34 pm, "Aleksey Gureev" <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
Aleksey Gureev
Guest
Posts: n/a
 
      03-08-2007
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". **** 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

 
Reply With Quote
 
Jason Cavett
Guest
Posts: n/a
 
      03-08-2007
On Mar 8, 5:01 am, "Aleksey Gureev" <(E-Mail Removed)> wrote:
> 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". **** 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


> 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". **** 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.

 
Reply With Quote
 
Aleksey Gureev
Guest
Posts: n/a
 
      03-08-2007
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
> > 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". **** 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.


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
> > 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.


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.

>
> 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).


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

 
Reply With Quote
 
Jason Cavett
Guest
Posts: n/a
 
      03-08-2007
On Mar 8, 10:37 am, "Aleksey Gureev" <(E-Mail Removed)> wrote:
> 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
> > > 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". **** 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.

>
> 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
> > > 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.

>
> 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.

>
> > 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).

>
> 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- Hide quoted text -
>
> - 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.

 
Reply With Quote
 
Joe Attardi
Guest
Posts: n/a
 
      03-08-2007
On Mar 8, 5:01 am, "Aleksey Gureev" <(E-Mail Removed)> wrote:
> 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




 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      03-09-2007
Aleksey Gureev wrote:
> 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)


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
 
Reply With Quote
 
Aleksey Gureev
Guest
Posts: n/a
 
      03-09-2007
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class & modifiers modifiers Miquel Ruby 4 01-26-2007 12:33 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
Modifiers applied to attributes, local variables, member functions, classes and inncer classes ! Razvan Java 11 07-17-2004 08:57 PM
Non access modifiers for Inner class variables shila Java 3 02-24-2004 06:06 PM
Exam 70-316: Default access modifiers =?ISO-8859-1?Q?Jo=E3o_Andr=E9_Correia_Rodrigues?= MCSD 1 07-14-2003 08:42 AM



Advertisments