Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: FW: [platform-swt-dev] Simulate a KeyPress Event

Thank you for your response.
I can do with the GC. If I use GC and Image, it gives me the Full Screen
Image.
To capture the particular view I need, I have to play with x & y
co-ordinates.

If I use the "ALT + PRINTSCREEN" event, I use the windows feature which
will 
copy only one window/view which is on focus in the image.

Hope I am clear about my problem.


Thanks & Regards,
Mani
-----Original Message-----
From: platform-swt-dev-bounces@xxxxxxxxxxx
[mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of Felipe
Heidrich
Sent: Friday, July 07, 2006 12:40 PM
To: Eclipse Platform SWT component developers list.
Subject: RE: FW: [platform-swt-dev] Simulate a KeyPress Event

Instead of faking a event why don't you create and GC in the display, 
create an Image, create a GC in the Image, copy area from the display gc

to the image gc, add the image to clipboard.
see
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.
snippets/src/org/eclipse/swt/snippets/Snippet215.java

Sorry if I misunderstood your problem,
felipe




"Chandra, Mani" <Mani.Chandra@xxxxxxxxxxxx> 
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx
07/07/2006 11:20 AM
Please respond to
"Eclipse Platform SWT component developers list." 
<platform-swt-dev@xxxxxxxxxxx>


To
"David Whiteman" <dlwhiteman@xxxxxxxxxxxxxxx>, "Eclipse Platform SWT 
component developers list." <platform-swt-dev@xxxxxxxxxxx>
cc

Subject
RE: FW: [platform-swt-dev] Simulate a KeyPress Event






I've actually posted the event. Its just missing in the snippet I sent.
 
                Event event = new Event();

                event.keyCode=SWT.PRINT_SCREEN;

                event.display=Display.getDefault();

                event.type=SWT.KeyDown;
 
                Display.getDefault().post(event);
 
                Clipboard clipboard = new
Clipboard(Display.getDefault());

                ImageTransfer imageTransfer =
ImageTransfer.getInstance();

                Object obj = clipboard.getContents(imageTransfer


Thanks & Regards,
Mani

-----Original Message-----
From: platform-swt-dev-bounces@xxxxxxxxxxx
[mailto:platform-swt-dev-bounces@xxxxxxxxxxx] On Behalf Of David
Whiteman
Sent: Friday, July 07, 2006 11:14 AM
To: Eclipse Platform SWT component developers list.
Subject: Re: FW: [platform-swt-dev] Simulate a KeyPress Event

Friday, July 7, 2006, 11:08:46 AM, Chandra, Mani wrote:

> Anybody who can help me on this?

For one thing, you created the Event object but you didn't
actually post it.

-- 
Regards,
David 
mailto:dlwhiteman@xxxxxxxxxxxxxxx
news://news.eclipse.org/eclipse.platform.swt
http://www.eclipse.org/newsportal/thread.php?group=eclipse.platform.swt


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top