Button UI Control - confirm with enter Key

Hi, how can I send a event by pressing the [Enter] key on the keyboard, instead of using:

on pressed do
on rightclick do

thx

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
citizenWOLF's picture

1. Use a macroscript.2. You

1. Use macroscript.
2. You can use ahk script to send your event.

ribis's picture

to a button.

to a button.

jahman's picture

.

use dotNetControl

try (destroydialog X ) catch ()
rollout X "" (
 
	dotNetControl btn "button" text:"SomeButton" height:20
 
	on X open do setFocus btn
 
	on btn KeyUp ev do (
 
		if ev.KeyCode == ev.KeyCode.Enter do format "Pressed Enter\n" 
 
	)
 
)
createDialog X
miauu's picture

.

But the rollout must be "on focus".

miauu's picture

.

Event to what? To a control in a rollout? To which control - button, checkbox, spinner,...?

liltaso2's picture

I think he means somehow

I think he means somehow making the enter key be able to be used to press ok (like when you are duplicating objects and the popup appear), perhaps accomplished by a macroscript to apply to that particular shortcut/key... or if Enter cant be used as shortcut, an alternative key

Taso

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.