SWT.KEYPAD_DECIMAL problem! [message #441993] |
Fri, 27 August 2004 09:26 |
Eclipse User |
|
|
|
Originally posted by: mattias.soderin.compiere.se
Hello
I have a problem with the keypad decimal key. It just won't add any
decimals to any of my textfields when I press it. I've also tried
keylisteners and adding listeners to SWT.KeyDown in the field and on the
display object. But no luck!
I'm using SWT on SuSE Linux. Eclipse 3.0
Any input would be greatly appreciated...
- Mattias
|
|
|
Re: SWT.KEYPAD_DECIMAL problem! [message #441994 is a reply to message #441993] |
Fri, 27 August 2004 09:39 |
Eclipse User |
|
|
|
Originally posted by: mattias.soderin.compiere.se
Mattias Söderin wrote:
> Hello
> I have a problem with the keypad decimal key. It just won't add any
> decimals to any of my textfields when I press it. I've also tried
> keylisteners and adding listeners to SWT.KeyDown in the field and on the
> display object. But no luck!
> I'm using SWT on SuSE Linux. Eclipse 3.0
> Any input would be greatly appreciated...
> - Mattias
BTW: Just to be clear: NumLock is activated...
|
|
|
Re: SWT.KEYPAD_DECIMAL problem! [message #442145 is a reply to message #441994] |
Fri, 27 August 2004 16:38 |
Eclipse User |
|
|
|
Originally posted by: Felipe_Heidrich.oti.com
This snippet worked fine for me:
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
text.addListener(SWT.Verify, new Listener() {
public void handleEvent(Event e) {
e.doit = !(SWT.KEYPAD_0 <= e.keyCode && e.keyCode <= SWT.KEYPAD_9);
}
});
text.setBounds(20, 20, 240, 220);
shell.setBounds(200, 200, 300, 300);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
Felipe
Mattias Söderin wrote:
> Mattias Söderin wrote:
> > Hello
> > I have a problem with the keypad decimal key. It just won't add any
> > decimals to any of my textfields when I press it. I've also tried
> > keylisteners and adding listeners to SWT.KeyDown in the field and on the
> > display object. But no luck!
> > I'm using SWT on SuSE Linux. Eclipse 3.0
> > Any input would be greatly appreciated...
> > - Mattias
> BTW: Just to be clear: NumLock is activated...
|
|
|
Re: SWT.KEYPAD_DECIMAL problem! [message #442146 is a reply to message #442145] |
Fri, 27 August 2004 16:42 |
Eclipse User |
|
|
|
Originally posted by: Felipe_Heidrich.oti.com
Ops, you just don't want the decimal symbol:
text.addListener(SWT.Verify, new Listener() {
public void handleEvent(Event e) {
e.doit = e.keyCode != SWT.KEYPAD_DECIMAL;
}
});
Let me know if this code works for you.
Felipe
Felipe Heidrich wrote:
> This snippet worked fine for me:
> public static void main(String[] args) {
> Display display = new Display();
> Shell shell = new Shell(display);
> Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
> text.addListener(SWT.Verify, new Listener() {
> public void handleEvent(Event e) {
> e.doit = !(SWT.KEYPAD_0 <= e.keyCode && e.keyCode <= SWT.KEYPAD_9);
> }
> });
> text.setBounds(20, 20, 240, 220);
> shell.setBounds(200, 200, 300, 300);
> shell.open();
> while (!shell.isDisposed()) {
> if (!display.readAndDispatch())
> display.sleep();
> }
> display.dispose();
> }
> Felipe
> Mattias Söderin wrote:
> > Mattias Söderin wrote:
> > > Hello
> > > I have a problem with the keypad decimal key. It just won't add any
> > > decimals to any of my textfields when I press it. I've also tried
> > > keylisteners and adding listeners to SWT.KeyDown in the field and on the
> > > display object. But no luck!
> > > I'm using SWT on SuSE Linux. Eclipse 3.0
> > > Any input would be greatly appreciated...
> > > - Mattias
> > BTW: Just to be clear: NumLock is activated...
|
|
|
Re: SWT.KEYPAD_DECIMAL problem! [message #442147 is a reply to message #442146] |
Fri, 27 August 2004 16:54 |
Eclipse User |
|
|
|
Originally posted by: felipe_heidrich.oti.com
I'm just too sleepy today... but I think I finally understood your
question.
Before running your application, or running Eclipse, use:
export LANG=en_US.UTF-8
setxkbmap us
eclipse
does the keypad decimal symbol works now ?
Enter a problem report against SWT (including your locale, keyboard
layout, and encoding).
Felipe
Felipe Heidrich wrote:
> Ops, you just don't want the decimal symbol:
> text.addListener(SWT.Verify, new Listener() {
> public void handleEvent(Event e) {
> e.doit = e.keyCode != SWT.KEYPAD_DECIMAL;
> }
> });
> Let me know if this code works for you.
> Felipe
> Felipe Heidrich wrote:
> > This snippet worked fine for me:
> > public static void main(String[] args) {
> > Display display = new Display();
> > Shell shell = new Shell(display);
> > Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
> > text.addListener(SWT.Verify, new Listener() {
> > public void handleEvent(Event e) {
> > e.doit = !(SWT.KEYPAD_0 <= e.keyCode && e.keyCode <= SWT.KEYPAD_9);
> > }
> > });
> > text.setBounds(20, 20, 240, 220);
> > shell.setBounds(200, 200, 300, 300);
> > shell.open();
> > while (!shell.isDisposed()) {
> > if (!display.readAndDispatch())
> > display.sleep();
> > }
> > display.dispose();
> > }
> > Felipe
> > Mattias Söderin wrote:
> > > Mattias Söderin wrote:
> > > > Hello
> > > > I have a problem with the keypad decimal key. It just won't add any
> > > > decimals to any of my textfields when I press it. I've also tried
> > > > keylisteners and adding listeners to SWT.KeyDown in the field and on
the
> > > > display object. But no luck!
> > > > I'm using SWT on SuSE Linux. Eclipse 3.0
> > > > Any input would be greatly appreciated...
> > > > - Mattias
> > > BTW: Just to be clear: NumLock is activated...
|
|
|
Re: SWT.KEYPAD_DECIMAL problem! [message #442223 is a reply to message #442147] |
Mon, 30 August 2004 06:36 |
Eclipse User |
|
|
|
Originally posted by: mattias.soderin.compiere.se
Thanks! I'm gonna try this!
- Mattias
Felipe Heidrich wrote:
> I'm just too sleepy today... but I think I finally understood your
> question.
> Before running your application, or running Eclipse, use:
> export LANG=en_US.UTF-8
> setxkbmap us
> eclipse
> does the keypad decimal symbol works now ?
> Enter a problem report against SWT (including your locale, keyboard
> layout, and encoding).
> Felipe
> Felipe Heidrich wrote:
> > Ops, you just don't want the decimal symbol:
> > text.addListener(SWT.Verify, new Listener() {
> > public void handleEvent(Event e) {
> > e.doit = e.keyCode != SWT.KEYPAD_DECIMAL;
> > }
> > });
> > Let me know if this code works for you.
> > Felipe
> > Felipe Heidrich wrote:
> > > This snippet worked fine for me:
> > > public static void main(String[] args) {
> > > Display display = new Display();
> > > Shell shell = new Shell(display);
> > > Text text = new Text(shell, SWT.MULTI | SWT.BORDER);
> > > text.addListener(SWT.Verify, new Listener() {
> > > public void handleEvent(Event e) {
> > > e.doit = !(SWT.KEYPAD_0 <= e.keyCode && e.keyCode <= SWT.KEYPAD_9);
> > > }
> > > });
> > > text.setBounds(20, 20, 240, 220);
> > > shell.setBounds(200, 200, 300, 300);
> > > shell.open();
> > > while (!shell.isDisposed()) {
> > > if (!display.readAndDispatch())
> > > display.sleep();
> > > }
> > > display.dispose();
> > > }
> > > Felipe
> > > Mattias Söderin wrote:
> > > > Mattias Söderin wrote:
> > > > > Hello
> > > > > I have a problem with the keypad decimal key. It just won't add any
> > > > > decimals to any of my textfields when I press it. I've also tried
> > > > > keylisteners and adding listeners to SWT.KeyDown in the field and on
> the
> > > > > display object. But no luck!
> > > > > I'm using SWT on SuSE Linux. Eclipse 3.0
> > > > > Any input would be greatly appreciated...
> > > > > - Mattias
> > > > BTW: Just to be clear: NumLock is activated...
|
|
|
Powered by
FUDForum. Page generated in 0.02831 seconds