Feature Request - Forum

Forum Navigation
You need to log in to create posts and topics.

Feature Request

Currently, if you have a text entry object, you must create a button to actually submit the data in the object for processing.  So I set out to see if I could make the ENTER key respond to the submit request.  I figured that I could find the status of the FOCUS of the object and IF the focus was on said text entry field, to respond to the ENTER key shortcut that was going to be set on the pulldown menu hotkey.

Two problems with that plan <grin>.   First I find no way to detect the focus of an object.   And of course the second is the fact that the "Enter" key is not an option to respond as a keyboard hotkey.

Might I request that you consider adding these to a future release?

Thanks

Hello,

Did you noticed in the doc:

[FocusedObject]

The name of the object that has the input focus.

And is it a good idea to set ENTER to an hotkey? In other objects of your app you may need the ENTER for normal working.

If then fire a hotkey, it would fail.

Regards

Hans-Peter

luishp and Vadim have reacted to this post.
luishpVadim

Just came back to report that I found [FocusedObject] just now ;-)   LOL   But also that is why  I needed to know what had focus, as then the enter key would only respond if said object had the focus.

How would putting a checkbox in text objects that was to "respond to the enter key" with perhaps a matching subroutine?   It's just that every text field folks generally type into responds to the enter key, to the point where it's a reflex when a person is done entering something.

Thanks Hans

In my ezChrome plugin demo I use the following code .. I use it in the text change action for the URL entry field..  This works fine..

SearchStr "[#13][#10]" "[Address_Entry]" "[EnterKeyPos]" ""
If "[EnterKeyPos]" ">" "0"
    StrReplace "[Address_Entry]" "[#13][#10]" "" "[Address_Entry]" ""
    ... do Enter key processing here
    ... AlertBox "Info" "Enter Key was pressed"
    ezChromeNavigate "Browser1" "[Address_Entry]"
EndIf

 

Vadim and rcohen have reacted to this post.
Vadimrcohen

@rcohen

You might want to search the NeoBook Forum (Archive) where this question was asked.

One solution was to ...

1) define the box to have a Multi-line property

2) set its height to look like a Single-line TextEntry Box

3) within the TextChange event code, look for the last thing to be typed as an Enter key (I think [#13][#10]) ... as soon as it is detected ...

a) remove those characters
b) do your Submit thing

... otherwise, do nothing.

 

luishp, Vadim and 2 other users have reacted to this post.
luishpVadimDarbdenralrcohen

@gaev @rcohen

Yes, I should have included the 1.) and 2.) from @gaev's post with my code.. So, set the properties to multiline and manually adjust height.. and then your set.  @rcohen I agree it's something that would be beneficial to include as a feature.  And if not possible.. I smell a new plugin coming from someone maybe?

 

rcohen has reacted to this post.
rcohen

@darbdenral

Sorry, I did not read your post before I posted mine ... it says the same thing :-))

Darbdenral has reacted to this post.
Darbdenral

@Gaev, No worries..  I'm glad you mentioned it.. :)

Quote from Darbdenral on November 10, 2021, 9:03 am

In my ezChrome plugin demo I use the following code .. I use it in the text change action for the URL entry field..  This works fine..

SearchStr "[#13][#10]" "[Address_Entry]" "[EnterKeyPos]" ""
If "[EnterKeyPos]" ">" "0"
StrReplace "[Address_Entry]" "[#13][#10]" "" "[Address_Entry]" ""
... do Enter key processing here
... AlertBox "Info" "Enter Key was pressed"
ezChromeNavigate "Browser1" "[Address_Entry]"
EndIf
SearchStr "[#13][#10]" "[Address_Entry]" "[EnterKeyPos]" "" If "[EnterKeyPos]" ">" "0" StrReplace "[Address_Entry]" "[#13][#10]" "" "[Address_Entry]" "" ... do Enter key processing here ... AlertBox "Info" "Enter Key was pressed" ezChromeNavigate "Browser1" "[Address_Entry]" EndIf
SearchStr "[#13][#10]" "[Address_Entry]" "[EnterKeyPos]" ""
If "[EnterKeyPos]" ">" "0"
    StrReplace "[Address_Entry]" "[#13][#10]" "" "[Address_Entry]" ""
    ... do Enter key processing here
    ... AlertBox "Info" "Enter Key was pressed"
    ezChromeNavigate "Browser1" "[Address_Entry]"
EndIf

 

That is brilliant, thank you.   I didn't think that [#10] or [#13] would trigger in a single line text box.    THANK YOU!!

Thanks Gaev,

THAT was the missing part... a multiline object. ;-)

Much appreciated all.