Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumsevent between the display and the system.
https://www.eclipse.org/forums/index.php/mv/msg/144139/453782/#msg_453782
to a display .
I can't find it in the source of swt. can anyone give more information
about that?
And But if the display (neither its shells ) is not focus,
how can the display (or shell)listen to
the key pressed of the OS ?
What I want is to set a shortcut key for my application .
that is , when my applicatin isn't in focus ,maybe running
in the background,it will react to the some keys of the OS when they are
pressed.
so I want to know whether can the display actively detect the key's
pressed event
of the system.
Thanks for your help !]]>bbskill2005-04-08T20:15:06-00:00Re: event between the display and the system.
https://www.eclipse.org/forums/index.php/mv/msg/144139/453838/#msg_453838
SWT programs include an event loop. The call to Display.readAndDispatch()
gets the next event from the event queue and dispatches it to the
appropriate widget. If you don't have an event loop, key and mouse events
won't get dispatched and your appliacation will appear hung.
If a shell is not in focus, then the key is not going to SWT, so it can't be
detected. There are low level Windows calls that allow you to see key
presses no matter which process is running but this is beyond the scope of
SWT.
"bbskill" <bbkills@tom.com> wrote in message
news:d36gqm$hji$1@news.eclipse.org...
> can anyone detailly tell me how the system post a event such as keyEvent
> to a display .
> I can't find it in the source of swt. can anyone give more information
> about that?
> And But if the display (neither its shells ) is not focus,
> how can the display (or shell)listen to
> the key pressed of the OS ?
> What I want is to set a shortcut key for my application .
> that is , when my applicatin isn't in focus ,maybe running
> in the background,it will react to the some keys of the OS when they are
> pressed.
> so I want to know whether can the display actively detect the key's
> pressed event
> of the system.
> Thanks for your help !]]>Steve Northover2005-04-11T20:30:22-00:00Re: event between the display and the system.
https://www.eclipse.org/forums/index.php/mv/msg/144139/453854/#msg_453854
display by going through the source of swt before.but I just can't find
the low level Windows calls by which the OS posts key events to the
event queue of the display . the information about the low level calls
between swt and the OS is little.
and the display can detect the position of mouse while it is not in
focus by calling a specific low level windows call . but the key event
is not the same as the OS will not help you application hold the key
event ,it just post the event to the display once the key event occurs.
so the display only can wait for the evet posted by OS passively,and it
is hard to check out which key pressed actively.
also Thanks for your opinion .
Steve Northover wrote:
> Background: The system posts events to the event queue for the process. All
> SWT programs include an event loop. The call to Display.readAndDispatch()
> gets the next event from the event queue and dispatches it to the
> appropriate widget. If you don't have an event loop, key and mouse events
> won't get dispatched and your appliacation will appear hung.
>
> If a shell is not in focus, then the key is not going to SWT, so it can't be
> detected. There are low level Windows calls that allow you to see key
> presses no matter which process is running but this is beyond the scope of
> SWT.
>
> "bbskill" <bbkills@tom.com> wrote in message
> news:d36gqm$hji$1@news.eclipse.org...
>
>>can anyone detailly tell me how the system post a event such as keyEvent
>>to a display .
>>I can't find it in the source of swt. can anyone give more information
>>about that?
>>And But if the display (neither its shells ) is not focus,
>>how can the display (or shell)listen to
>>the key pressed of the OS ?
>>What I want is to set a shortcut key for my application .
>>that is , when my applicatin isn't in focus ,maybe running
>>in the background,it will react to the some keys of the OS when they are
>>pressed.
>>so I want to know whether can the display actively detect the key's
>>pressed event
>>of the system.
>>Thanks for your help !
>
>
>]]>bbskill2005-04-12T15:34:26-00:00Re: event between the display and the system.
https://www.eclipse.org/forums/index.php/mv/msg/144139/453901/#msg_453901
get what you want using Windows Hooks.
"bbskill" <bbkills@tom.com> wrote in message
news:d3ghuk$a8p$1@news.eclipse.org...
> I have found out that the relationship between the event loop and the
> display by going through the source of swt before.but I just can't find
> the low level Windows calls by which the OS posts key events to the
> event queue of the display . the information about the low level calls
> between swt and the OS is little.
> and the display can detect the position of mouse while it is not in
> focus by calling a specific low level windows call . but the key event
> is not the same as the OS will not help you application hold the key
> event ,it just post the event to the display once the key event occurs.
> so the display only can wait for the evet posted by OS passively,and it
> is hard to check out which key pressed actively.
> also Thanks for your opinion .
>
> Steve Northover wrote:
> > Background: The system posts events to the event queue for the process.
All
> > SWT programs include an event loop. The call to
Display.readAndDispatch()
> > gets the next event from the event queue and dispatches it to the
> > appropriate widget. If you don't have an event loop, key and mouse
events
> > won't get dispatched and your appliacation will appear hung.
> >
> > If a shell is not in focus, then the key is not going to SWT, so it
can't be
> > detected. There are low level Windows calls that allow you to see key
> > presses no matter which process is running but this is beyond the scope
of
> > SWT.
> >
> > "bbskill" <bbkills@tom.com> wrote in message
> > news:d36gqm$hji$1@news.eclipse.org...
> >
> >>can anyone detailly tell me how the system post a event such as keyEvent
> >>to a display .
> >>I can't find it in the source of swt. can anyone give more information
> >>about that?
> >>And But if the display (neither its shells ) is not focus,
> >>how can the display (or shell)listen to
> >>the key pressed of the OS ?
> >>What I want is to set a shortcut key for my application .
> >>that is , when my applicatin isn't in focus ,maybe running
> >>in the background,it will react to the some keys of the OS when they are
> >>pressed.
> >>so I want to know whether can the display actively detect the key's
> >>pressed event
> >>of the system.
> >>Thanks for your help !
> >
> >
> >]]>Steve Northover2005-04-13T17:17:49-00:00Re: event between the display and the system.
https://www.eclipse.org/forums/index.php/mv/msg/144139/453932/#msg_453932
and it has to use JNI,I don't want that my application depends on some
platform.I just want to see whether the SWT solved this problem .
Steve Northover wrote:
> You will have to search the MSDN for the API you need. I believe you can
> get what you want using Windows Hooks.
>
> "bbskill" <bbkills@tom.com> wrote in message
> news:d3ghuk$a8p$1@news.eclipse.org...
>
>>I have found out that the relationship between the event loop and the
>>display by going through the source of swt before.but I just can't find
>>the low level Windows calls by which the OS posts key events to the
>>event queue of the display . the information about the low level calls
>>between swt and the OS is little.
>>and the display can detect the position of mouse while it is not in
>>focus by calling a specific low level windows call . but the key event
>>is not the same as the OS will not help you application hold the key
>>event ,it just post the event to the display once the key event occurs.
>>so the display only can wait for the evet posted by OS passively,and it
>>is hard to check out which key pressed actively.
>>also Thanks for your opinion .
>>
>>Steve Northover wrote:
>>
>>>Background: The system posts events to the event queue for the process.
>
> All
>
>>>SWT programs include an event loop. The call to
>
> Display.readAndDispatch()
>
>>>gets the next event from the event queue and dispatches it to the
>>>appropriate widget. If you don't have an event loop, key and mouse
>
> events
>
>>>won't get dispatched and your appliacation will appear hung.
>>>
>>>If a shell is not in focus, then the key is not going to SWT, so it
>
> can't be
>
>>>detected. There are low level Windows calls that allow you to see key
>>>presses no matter which process is running but this is beyond the scope
>
> of
>
>>>SWT.
>>>
>>>"bbskill" <bbkills@tom.com> wrote in message
>>>news:d36gqm$hji$1@news.eclipse.org...
>>>
>>>
>>>>can anyone detailly tell me how the system post a event such as keyEvent
>>>>to a display .
>>>>I can't find it in the source of swt. can anyone give more information
>>>>about that?
>>>>And But if the display (neither its shells ) is not focus,
>>>>how can the display (or shell)listen to
>>>>the key pressed of the OS ?
>>>>What I want is to set a shortcut key for my application .
>>>>that is , when my applicatin isn't in focus ,maybe running
>>>>in the background,it will react to the some keys of the OS when they are
>>>>pressed.
>>>>so I want to know whether can the display actively detect the key's
>>>>pressed event
>>>>of the system.
>>>>Thanks for your help !
>>>
>>>
>>>
>
>]]>bbskill2005-04-14T11:07:09-00:00