mIRC Home    About    Download    Register    News    Help

Print Thread
#111611 17/02/05 06:45 AM
Joined: Oct 2003
Posts: 37
R
Rumie Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Oct 2003
Posts: 37
How to detect enter in dialog?

#111612 17/02/05 08:04 AM
Joined: Sep 2004
Posts: 237
Fjord artisan
Offline
Fjord artisan
Joined: Sep 2004
Posts: 237
Can you give just a little more info please?

#111613 17/02/05 08:50 AM
Joined: Oct 2003
Posts: 37
R
Rumie Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Oct 2003
Posts: 37
like... when i typed something in editbox and press enter, the dialog detect the enter and i can do something with it...

#111614 17/02/05 08:52 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
You can't actually detect the enter key being pressed, but you can make it so a button is clicked when you press enter.
For example, let's say you're writing a chat client and you have a "Send" button to send a message, you could make pressing enter in the editbox do the same as pressing Send.

Is that what you want?

Edit, here's an example:

Code:
dialog EE {
  title "Enter Example"
  size -1 -1 158 24
  option dbu
  button "Test", 1, 121 12 37 12, ok
  edit "", 2, 0 0 158 10, result
}
on *:dialog:EE:sclick:1:{ 
  .echo -q $input(You clicked "Test" or pressed Enter!,oid,Click!)
  halt 
}


Because the editbox (id 2) has the "result" property specified, the ok button (id 1) is clicked when you press enter, when the button is clicked you must add a /halt otherwise the dialog will close.

Last edited by tidy_trax; 17/02/05 08:59 AM.

New username: hixxy
#111615 17/02/05 06:15 PM
Joined: Feb 2005
Posts: 34
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Feb 2005
Posts: 34
couldn't you use the keydown event along with $dialog(dname) == $active)

#111616 17/02/05 08:39 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Keydown/keyup events only trigger for @windows.


New username: hixxy

Link Copied to Clipboard