
Quote from rcohen on November 10, 2021, 6:03 amCurrently, 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
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

Quote from HPW on November 10, 2021, 8:02 amHello,
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
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

Quote from rcohen on November 10, 2021, 8:26 amJust 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
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

Quote from Darbdenral on November 10, 2021, 9:03 amIn 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
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
Quote from Gaev on November 10, 2021, 3:41 pm@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.
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.

Quote from Darbdenral on November 10, 2021, 9:00 pm@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?
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?
Quote from Gaev on November 10, 2021, 9:42 pm@darbdenral
Sorry, I did not read your post before I posted mine ... it says the same thing :-))
Sorry, I did not read your post before I posted mine ... it says the same thing :-))

Quote from Darbdenral on November 10, 2021, 10:30 pm@Gaev, No worries.. I'm glad you mentioned it.. :)
@Gaev, No worries.. I'm glad you mentioned it.. :)

Quote from rcohen on November 10, 2021, 11:13 pmQuote from Darbdenral on November 10, 2021, 9:03 amIn 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]"EndIfSearchStr "[#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]" EndIfSearchStr "[#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!!
Quote from Darbdenral on November 10, 2021, 9:03 amIn 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]"EndIfSearchStr "[#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]" EndIfSearchStr "[#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!!

Quote from rcohen on November 10, 2021, 11:22 pmThanks Gaev,
THAT was the missing part... a multiline object. ;-)
Much appreciated all.
Thanks Gaev,
THAT was the missing part... a multiline object. ;-)
Much appreciated all.