Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 10 total
Thread focus in a grid
Sat, Dec 1 2007 3:25 PMPermanent Link

"Andrej Bivic"
Hi, I need an advise... so, if you would be so kind and help me with this
one, please.

In my app is most important, that I allways have a keyboard focus in a grid.
If I need some function, I use popup-menus and function keys. With a
function key, I "jump" in some other edit-components or open another form
and then "jump" back on that grid.
But, let say, the user presses "window button" and the "Start menu" rises.
How do I prevent this, since focus goes out of my app and I can not get back
(user) withou a mouse?
please, advise.

Sat, Dec 1 2007 9:10 PMPermanent Link

Eryk Bottomley
Andrej,

> But, let say, the user presses "window button" and the "Start menu" rises.
> How do I prevent this, since focus goes out of my app and I can not get back
> (user) withou a mouse?

You would need to implement system wide keyboard hooks to do that. It is
not trivial. Here is a relevant URL:

http://www.delphifaq.com/faq/delphi_windows_API/f512.shtml

....this sort of thing may well not work with Vista by the way.

Eryk
Tue, Dec 4 2007 6:36 AMPermanent Link

Chris Erdal
"Andrej Bivic" <andrej.bivic@abitrade.si> wrote in
news:8BC07A46-3F5F-485F-B04D-FA8DC35B6944@news.elevatesoft.com:

> But, let say, the user presses "window button" and the "Start menu"
> rises. How do I prevent this, since focus goes out of my app and I can
> not get back (user) withou a mouse?
> please, advise.

Could you put something into the onIdle event to check the app still has
focus, and if not send "Esc" to the Start menu or whatever else is now
active? (I've never tried this kind of thing BTW - only thinking out loud)

--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)

Tue, Dec 4 2007 8:10 AMPermanent Link

"Robert"

"Chris Erdal" <chris@No-Spam-erdal.net> wrote in message
news:Xns99FC7F5DC19B614torcatis@64.65.248.118...
> "Andrej Bivic" <andrej.bivic@abitrade.si> wrote in
> news:8BC07A46-3F5F-485F-B04D-FA8DC35B6944@news.elevatesoft.com:
>
>> But, let say, the user presses "window button" and the "Start menu"
>> rises. How do I prevent this, since focus goes out of my app and I can
>> not get back (user) withou a mouse?
>> please, advise.
>
> Could you put something into the onIdle event to check the app still has
> focus, and if not send "Esc" to the Start menu or whatever else is now
> active? (I've never tried this kind of thing BTW - only thinking out loud)
>

I don't know. In Windows, or any other multi-application OS, if the user
passes control to another process, you should just sit there doing nothing.
The assumption that your program - not the user or the OS - controls the
machine is pretty dangerous, IMO. Not to mention that if your program for
whatever reason can not terminate normally, the only solution is to shoot
the computer Smiley

Robert

> --
> Chris
> (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)
>
>

Tue, Dec 4 2007 9:08 AMPermanent Link

Eryk Bottomley
Robert,

> The assumption that your program - not the user or the OS - controls the
> machine is pretty dangerous, IMO.

Depends on the application. In several of my systems (security control
and manufacturing QA, for example) the 'user' is a peripheral and has no
more business 'controlling' anything than a printer or a scanner.
Constantly fighting the assumption that 'users' always control their PC
rather than the other way around has been the bane of my life for over a
decade Wink

Eryk
Tue, Dec 4 2007 9:41 AMPermanent Link

"Robert"

"Eryk Bottomley" <no@way.com> wrote in message
news:18724833-6BAA-407F-A64A-CC56F9A85B07@news.elevatesoft.com...
> Robert,
>
>> The assumption that your program - not the user or the OS - controls the
>> machine is pretty dangerous, IMO.
>
> Depends on the application. In several of my systems (security control and
> manufacturing QA, for example) the 'user' is a peripheral and has no more
> business 'controlling' anything than a printer or a scanner.

What you're running is not a typical Windows PC. In a Windows PC control of
which program is active does not "depend on the application". All programs
are equal.  Of course if you have a PC dedicated to running your toaster,
then it is not a typical Windows PC, even if for convenience you run
Windows. One can always find an exception.

But in this case, there is an attempt to maintain focus on a certain control
even if the system or the user needs to go somewhere else. That is against
all rules of multi-application systems.

Robert


Tue, Dec 4 2007 9:44 AMPermanent Link

Chris Erdal
Eryk Bottomley <no@way.com> wrote in
news:18724833-6BAA-407F-A64A-CC56F9A85B07@news.elevatesoft.com:

> Robert,
>
>> The assumption that your program - not the user or the OS - controls
>> the machine is pretty dangerous, IMO.
>
> Depends on the application. In several of my systems (security control
> and manufacturing QA, for example) the 'user' is a peripheral and has
> no more business 'controlling' anything than a printer or a scanner.
> Constantly fighting the assumption that 'users' always control their
> PC rather than the other way around has been the bane of my life for
> over a decade Wink
>
> Eryk

I suggested this because Andrej mentioned his user couldn't use a mouse,
and I imagined he had very special needs which MIGHT imply that only his
program was accessible most of the time (hence the question rather than
an answer).

But I must also say that if I stumbled on a program using my suggested
technique, it would very quickly be un-installed from my PC!

Perhaps you could give us a little more information, Andrej?
--
Chris
(XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)

Tue, Dec 4 2007 9:58 AMPermanent Link

Eryk Bottomley
Robert,

> What you're running is not a typical Windows PC.

Correct, and what I actually do is replace the entire shell with a
custom AppBar and disconnect the Ctrl-Alt-Del keys. The latter is the
really annoying bit - not being able to intercept this in software means
that the carbon based robotic appliance would otherwise be able to
override its silicon based overlord - wholly unacceptable!! Wink

Eryk
Tue, Dec 4 2007 11:15 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Robert


From what I've seen of it Andrej's app is POS. You don't really want them messing around with ANYTHING apart from the POS software eg wander off and send an email whilst making the customer wait - they already have enough ways of making me wait Smiley

Roy Lambert
Thu, Dec 6 2007 11:32 AMPermanent Link

"Andrej Bivic"
It is all about POS system. A simple PC cash-register. And since the
operator needs both hands it is necessary to operate without a mouse. Only
keyboard. And there is a "Start-key" there. So, I would remove a key and
problem solved Smile
Andrej

"Chris Erdal" <chris@No-Spam-erdal.net> wrote in message
news:Xns99FC9F4EC565114torcatis@64.65.248.118...
> Eryk Bottomley <no@way.com> wrote in
> news:18724833-6BAA-407F-A64A-CC56F9A85B07@news.elevatesoft.com:
>
>> Robert,
>>
>>> The assumption that your program - not the user or the OS - controls
>>> the machine is pretty dangerous, IMO.
>>
>> Depends on the application. In several of my systems (security control
>> and manufacturing QA, for example) the 'user' is a peripheral and has
>> no more business 'controlling' anything than a printer or a scanner.
>> Constantly fighting the assumption that 'users' always control their
>> PC rather than the other way around has been the bane of my life for
>> over a decade Wink
>>
>> Eryk
>
> I suggested this because Andrej mentioned his user couldn't use a mouse,
> and I imagined he had very special needs which MIGHT imply that only his
> program was accessible most of the time (hence the question rather than
> an answer).
>
> But I must also say that if I stumbled on a program using my suggested
> technique, it would very quickly be un-installed from my PC!
>
> Perhaps you could give us a little more information, Andrej?
> --
> Chris
> (XP-Pro + Delphi 7 Architect + DBISAM 4.25 build 4 + EDB 1.04 build 3)
>
>

Image