It is currently March 29th, 2024, 5:53 am

Working with InputText

Our most popular Tips and Tricks from the Rainmeter Team and others
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Working with InputText

Post by Active Colors »

pul53dr1v3r wrote: February 16th, 2021, 6:11 pm i just had in my mind a plugin option to set a minimal number of characters in an input text measure as leaving it empty can cause errors in certain cases, especially where numeric values are required. Adding additional measure for every InputText measure could be a headache for those who use the plugin. The option should return the last entered value if the number of entered characters is less than the determined with the option.
If InputLimit option (for max number of characters) is necessary, why not to add this one? Can't InputLimit be achieved without the option? It can, but that's much easier way for many users, less code, resource usage...

Just a suggestion for devs with a BIG thanks for all the work up to now!
I understand what you mean. As a solution at this moment for your case you still can have just only one measure and set individual limits from any input element.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Working with InputText

Post by pul53dr1v3r »

Active Colors wrote: February 17th, 2021, 8:23 am I understand what you mean. As a solution at this moment for your case you still can have just only one measure and set individual limits from any input element.
Yes, using many InputText measures by me is not a very smart solution as i prefer less the code and better performance, but it's being partially corrected yet. Thanks for the advice! :rosegift:
akthegreat
Posts: 1
Joined: September 28th, 2021, 7:05 am

Re: Working with InputText

Post by akthegreat »

Had a question about InputText. I had downloaded a search engine skin a while ago and recently wanted to search for the answer to an equation (don't remember the exact equation, but addition is relevant to the problem, so let's just say "2+2"). However, when it goes through to whatever search engine is selected, it comes out as "2 2" instead. I tried this with other skins too, including Illustro's google skin, but the same thing happens. This doesn't seem to be a problem with any of the other arithmetic operations. Is this lack of a plus sign a problem on my end or something to do with the InputText Plugin itself?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

Post by jsmorley »

The problem with this is not with InputText, that is fine with the + symbol. The problem is that when something like "2+2" is passed to Google Search, the + has a specific meaning. It means "must include the following". So it really means "2" and must be followed by "2".

I'll have to chew on how you might get around this...
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: Working with InputText

Post by death.crafter »

jsmorley wrote: October 2nd, 2021, 12:28 pm The problem with this is not with InputText, that is fine with the + symbol. The problem is that when something like "2+2" is passed to Google Search, the + has a specific meaning. It means "must include the following". So it really means "2" and must be followed by "2".

I'll have to chew on how you might get around this...
EncodeUrl ?
from the Realm of Death
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Working with InputText

Post by jsmorley »

death.crafter wrote: October 2nd, 2021, 12:39 pm EncodeUrl ?
Yep...

Code: Select all

[MeterInputBack]
Meter=Image
X=74
Y=36
W=260
H=30
SolidColor=30,30,30,255
LeftMouseUpAction=[!CommandMeasure MeasureInput "ExecuteBatch 1-2"]

[MeasureInput]
Measure=Plugin
Plugin=InputText.dll
X=74
Y=38
W=260
H=26
FontColor=255,255,255,255
SolidColor=30,30,30,255
FontFace=Segoe UI
FontSize=11
AntiAlias=1
FocusDismiss=1
DynamicVariables=1
Command1=$UserInput$
Command2=["https://www.google.com/search?q=[MeasureInput:EncodeURL]#SearchCat#"]
GoogleIt_2.0.rmskin

1.png

2.png
You do not have the required permissions to view the files attached to this post.
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Working with InputText

Post by David8192 »

  Uhmmm.  
So....., by google, is this "%" percentage or modulus?
Image
You do not have the required permissions to view the files attached to this post.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Working with InputText

Post by balala »

David8192 wrote: October 11th, 2021, 6:45 pm So....., by google, is this "%" percentage or modulus?
I think as usually, % is percentage:
GoogleCalc.png
As you can see in the above screenshot, when I tried introducing (13%4) (which if the % would be the modulo operation should give 1) I got (13%x4). Accordingly the result is 0.52, which represents exactly 13% of 4.
You do not have the required permissions to view the files attached to this post.
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: Working with InputText

Post by David8192 »

balala wrote: October 11th, 2021, 7:41 pm I think as usually, % is percentage:
As you can see in the above screenshot, when I tried introducing (13%4) (which if the % would be the modulo operation should give 1) I got (13%x4). Accordingly the result is 0.52, which represents exactly 13% of 4.
Uh! I see. :great:
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
Crest
Posts: 113
Joined: August 16th, 2013, 12:47 pm

Re: Working with InputText

Post by Crest »

Couldn't find anything during my searching but I've been encountering an unexpected behavior with InputText and colon characters.

If I input for example 10:30 then a Windows dialog appears saying:
No apps are installed to open this type of link (10)

Look for an app in the store
Similarly occurs if I enter something like foo:bar (the dialog then says the type of link is 'foo'). I've observed the dialog doesn't appear for strings where the sub-string before the colon is a digit lower than '10' such as '9'.

Nevertheless the designated output variable correctly stores the string. It's just it would be preferable to not have a Windows dialog appear (and I'm not sure why it even does to begin since I thought the input was passed exclusively to Rainmeter).

If, OTOH, I input strings with spaces around the colon such as 10 : 30 the dialog doesn't appear.

Is this behavior documented somewhere and is there a way to prevent it for strings that lack spaces?

Edit: I notice at the end of the OP some examples of it handling opening URLs natively without any configuration, which I suppose is why it thinks the first sub-string is a protocol. Can link handling be disabled or be worked around somehow?



Edit 2: for reference I'm using jsmorley's method of re-using the $UserInput$ variable as shown here. This involves setting Command1 as the raw $UserInput$ then referencing it via the measure's name in subsequent Command actions. So it would seem that by defining it in Command1 it triggers the URL handling initially, which I'm hoping to avoid.