Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Delete Key keyCode on Mac not SWT.DEL?
Delete Key keyCode on Mac not SWT.DEL? [message #438117] Wed, 16 June 2004 16:05 Go to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Hi,

I've added a KeyListener to a tree listening for SWT.CR and SWT.DEL. On
Mac pressing Enter, the event is triggered for SWT.CR. That's ok. But
pressing the delete key the keycode does not seem to be SWT.DEL.
Unfortunately I am not able to test that, just got someone that reported
this problem.

Any suggestions? Is it a different keycode on Mac?

Regards,
Ben
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438218 is a reply to message #438117] Thu, 17 June 2004 15:44 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
WORKSFORME. In the 3.0 stream on the Mac,
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet25.html
gives:

DOWN: stateMask=0x0, keyCode=0x7f DEL, character=0x7f DEL
UP : stateMask=0x0, keyCode=0x7f DEL, character=0x7f DEL

"Benjamin Pasero" <bpasero@rssowl.org> wrote in message
news:capr4f$n2j$1@eclipse.org...
> Hi,
>
> I've added a KeyListener to a tree listening for SWT.CR and SWT.DEL. On
> Mac pressing Enter, the event is triggered for SWT.CR. That's ok. But
> pressing the delete key the keycode does not seem to be SWT.DEL.
> Unfortunately I am not able to test that, just got someone that reported
> this problem.
>
> Any suggestions? Is it a different keycode on Mac?
>
> Regards,
> Ben
>
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438225 is a reply to message #438218] Thu, 17 June 2004 16:33 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Hm, maybe it has something to do with how I listen for the event. I am
using
Tree.addKeyListener listening for keyPressed event and comparing e.keyCode
to SWT.DEL. As I mentioned, Enter Key is catched by this code, Del is not.
But maybe its the Mac user that did something wrong, I am going to ask him
again.

Thanks,
ben

> WORKSFORME. In the 3.0 stream on the Mac,
>
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/plat form-swt-home/snippits/snippet25.html
> gives:

> DOWN: stateMask=0x0, keyCode=0x7f DEL, character=0x7f DEL
> UP : stateMask=0x0, keyCode=0x7f DEL, character=0x7f DEL

> "Benjamin Pasero" <bpasero@rssowl.org> wrote in message
> news:capr4f$n2j$1@eclipse.org...
> > Hi,
> >
> > I've added a KeyListener to a tree listening for SWT.CR and SWT.DEL. On
> > Mac pressing Enter, the event is triggered for SWT.CR. That's ok. But
> > pressing the delete key the keycode does not seem to be SWT.DEL.
> > Unfortunately I am not able to test that, just got someone that reported
> > this problem.
> >
> > Any suggestions? Is it a different keycode on Mac?
> >
> > Regards,
> > Ben
> >
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438263 is a reply to message #438225] Fri, 18 June 2004 11:47 Go to previous messageGo to next message
Douglas Pollock is currently offline Douglas PollockFriend
Messages: 84
Registered: July 2009
Member
Benjamin Pasero wrote:

> Hm, maybe it has something to do with how I listen for the event. I am
> using
> Tree.addKeyListener listening for keyPressed event and comparing e.keyCode
> to SWT.DEL. As I mentioned, Enter Key is catched by this code, Del is not.
> But maybe its the Mac user that did something wrong, I am going to ask him
> again.

This may not be the case for you, but I have one instance of someone
mistakenly thinking the "backspace" key was the "delete" key. This can
happen as some Apple keyboards do not have a "delete" key.



cheers,
d.
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438272 is a reply to message #438263] Fri, 18 June 2004 15:36 Go to previous messageGo to next message
Benjamin Pasero is currently offline Benjamin PaseroFriend
Messages: 337
Registered: July 2009
Senior Member
Douglas Pollock wrote:

> Benjamin Pasero wrote:

> > Hm, maybe it has something to do with how I listen for the event. I am
> > using
> > Tree.addKeyListener listening for keyPressed event and comparing e.keyCode
> > to SWT.DEL. As I mentioned, Enter Key is catched by this code, Del is not.
> > But maybe its the Mac user that did something wrong, I am going to ask him
> > again.

> This may not be the case for you, but I have one instance of someone
> mistakenly thinking the "backspace" key was the "delete" key. This can
> happen as some Apple keyboards do not have a "delete" key.

Ah thanks for the info! I think I am going to allow the backspace key for
Mac users.



> cheers,
> d.
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438285 is a reply to message #438263] Sat, 19 June 2004 05:53 Go to previous messageGo to next message
Brion Vibber is currently offline Brion VibberFriend
Messages: 21
Registered: July 2009
Junior Member
Douglas Pollock wrote:
> This may not be the case for you, but I have one instance of someone
> mistakenly thinking the "backspace" key was the "delete" key. This can
> happen as some Apple keyboards do not have a "delete" key.

That's not a mistake; what PC users would call "backspace" is in fact
*labeled* "delete" on a Mac keyboard. This key is present on every Mac
keyboard, and behaves like you'd expect "backspace" to behave as well as
being used to delete things from lists, etc.

Full-size Mac keyboards have another "delete" key where PC users would
expect it, which behaves like a PC "delete" key. This key is not present
on Mac laptop keyboards, so shouldn't be relied upon.

-- brion vibber (brion @ pobox.com)
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438299 is a reply to message #438285] Mon, 21 June 2004 11:43 Go to previous messageGo to next message
b0bben is currently offline b0bbenFriend
Messages: 1
Registered: July 2009
Junior Member
Brion Vibber wrote:

> Douglas Pollock wrote:
> > This may not be the case for you, but I have one instance of someone
> > mistakenly thinking the "backspace" key was the "delete" key. This can
> > happen as some Apple keyboards do not have a "delete" key.

> That's not a mistake; what PC users would call "backspace" is in fact
> *labeled* "delete" on a Mac keyboard. This key is present on every Mac
> keyboard, and behaves like you'd expect "backspace" to behave as well as
> being used to delete things from lists, etc.

> Full-size Mac keyboards have another "delete" key where PC users would
> expect it, which behaves like a PC "delete" key. This key is not present
> on Mac laptop keyboards, so shouldn't be relied upon.

> -- brion vibber (brion @ pobox.com)


On Mac laptops, Fn-Backspace combination gives PC-style delete.

Cheers
b0bben
Re: Delete Key keyCode on Mac not SWT.DEL? [message #438314 is a reply to message #438299] Mon, 21 June 2004 22:22 Go to previous message
Brion Vibber is currently offline Brion VibberFriend
Messages: 21
Registered: July 2009
Junior Member
Bob wrote:
> Brion Vibber wrote:
>>Full-size Mac keyboards have another "delete" key where PC users would
>>expect it, which behaves like a PC "delete" key. This key is not present
>>on Mac laptop keyboards, so shouldn't be relied upon.
>
> On Mac laptops, Fn-Backspace combination gives PC-style delete.

That trick is neither labeled nor obvious; I wouldn't rely on the user
knowing it.

-- brion vibber (brion @ pobox.com)
Previous Topic:Image Capture
Next Topic:AWT container in a SWT wizard
Goto Forum:
  


Current Time: Sat Apr 27 01:10:13 GMT 2024

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

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

Back to the top