Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
121 user(s) are online (84 user(s) are browsing Forums)

Members: 2
Guests: 119

Firetail, trixie, more...

Headlines

 
  Register To Post  

[Solved] Default button
Supreme Council
Supreme Council


See User information
I'm trying to make a button the default operation when the user press the "enter" key. Like most requesters have.

I have my own custom requester, a window with some reaction gadgets in it.

GA_ActivateKey, "RETURN", or similar doesn't seem to work.

any ideas how to make this work?


Edited by orgin on 2010/3/28 12:53:23
Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Default button
Home away from home
Home away from home


See User information
@orgin
Dunno about Reaction, but for GadTools all I needed to do in my E code was:

* Make the OK text bold by supplying a "textattr" object with the FSF_BOLD style.
* Request that my window receives IDCMP_VANILLAKEY events.
* Have my event loop look for a IDCMP_VANILLAKEY event which has code=13 (Enter).

I also made the Cancel button respond to the Escape key, by looking for code=27.

Author of the PortablE programming language.
Go to top
Re: Default button
Supreme Council
Supreme Council


See User information
Unfortunately events are propagated from string gadgets. Seems there has to be a better way to do this.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: Default button
Supreme Council
Supreme Council


See User information
Ohh well, I changed to RAWKEY instead to get it to work. The rawkey down strokes aren't propagated from string gadgets so I can get around it that way.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: [Solved] Default button
Just can't stay away
Just can't stay away


See User information
@orgin

String gadgets have a hook which is used to do character conversion on the fly. Check the Enter key there. If the string gadget is not active then IDCMP_RAWKEY / IDCMP_VANILLAKEY should work. (Use both methods.)

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top
Re: [Solved] Default button
Supreme Council
Supreme Council


See User information
@TSK

It's already solved, as described above.

Vacca foeda. Sum, ergo edo

Mr Bobo Cornwater
Go to top
Re: [Solved] Default button
Just can't stay away
Just can't stay away


See User information
@orgin

I didn't read your post too carefully. I had to read it again before understanding it.

Rock lobster bit me - so I'm here forever
X1000 + AmigaOS 4.1 FE
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project