Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Fonts and Keyboard State
Fonts and Keyboard State [message #466964] Fri, 20 January 2006 07:43 Go to next message
Adam Kumpf is currently offline Adam KumpfFriend
Messages: 14
Registered: July 2009
Junior Member
Hello,

Does anyone know of a way to get a key stateMask (to see if control,
shift, etc.) are being pushed without explicitly creating a handful of
keydown, keyup listeners?

Also, I really like to serialize classes to save state of objects I'm
using in various places. What is the best way to store and set font
information? Can I build a font without putting it on a display? or is
there a way to easily extract the font information into a
display-independant variable so that it can be serialized and re-loaded
later?

Thanks,
Adam
kumpf@mit.edu
Re: Fonts and Keyboard State [message #467127 is a reply to message #466964] Wed, 25 January 2006 16:02 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.stefkoch.net

Adam Kumpf wrote:
> Hello,
>
> Does anyone know of a way to get a key stateMask (to see if control,
> shift, etc.) are being pushed without explicitly creating a handful of
> keydown, keyup listeners?
>
> Also, I really like to serialize classes to save state of objects I'm
> using in various places. What is the best way to store and set font
> information? Can I build a font without putting it on a display? or is
> there a way to easily extract the font information into a
> display-independant variable so that it can be serialized and re-loaded
> later?
>
> Thanks,
> Adam
> kumpf@mit.edu
>
>
>
>

try this

static String stateMask(int stateMask) {
String string = "";
if ((stateMask & SWT.CTRL) != 0)
string += " CTRL";
if ((stateMask & SWT.ALT) != 0)
string += " ALT";
if ((stateMask & SWT.SHIFT) != 0)
string += " SHIFT";
if ((stateMask & SWT.COMMAND) != 0)
string += " COMMAND";
return string;
}


u can retrieve the stateMask from the event by using e.stateMask

regards,
stefan
Previous Topic:Updating SWT with J9 on Pocket PC
Next Topic:Tree with a editor with properties
Goto Forum:
  


Current Time: Mon Jun 17 02:33:32 GMT 2019

Powered by FUDForum. Page generated in 0.02239 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top