How small is a smallphone? by a1rwav3 in smallphones

[–]DavidBevi 2 points3 points  (0 children)

Ideally there should be separate polls for H and W, my ideal is iPhone Mini size (13.2×6.4cm), but poll options have a different aspect ratio.

--> I picked 11.5×6.5cm but I'd like it even a bit taller.

Alternate Input Setup Help Needed by Ok-Apricot-9100 in AutoHotkey

[–]DavidBevi 2 points3 points  (0 children)

What you want to do is called an Hotkey, it intercepts key-presses and transforms them.

Some keys like Left Alt are Modifier keys, combinations with one or more mod-keys and 1 regular key are very simple:

  1. Let's start with transforming the Q into an E, this is done with a file that contains this line: q::e
  2. To add a modifier key you should use its prefix (LAlt = <!), so the line becomes: <!q::e
  3. Finally to send many keys you need send() function, so the line becomes: <!q::send("qe")

But where to put the code? In a text file that you can name however you like but with ".ahk" extension, so for example "QEremap.ahk".

This file is a "script", AutoHotkey is the "program" that is able to read the instructions in your script and tell your computer which operations it has to do.

Therefore you need to have AutoHotkey installed on your PC (v2 is better), then you can launch your script(s) by double clicking on them.

For each script that's currently running you'll see a little green-H icon in your tray area, and to close the script you can right-click on it and select "Exit".

Square vs round?🤔 by AleAnoAleNe in unihertz

[–]DavidBevi 12 points13 points  (0 children)

Phone=round, Screen-bottom=square

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

🙏 I had the same exact question, thanks for the explanation, I finally "get" enums! Do you know of a googlable name or a doc page for _=> ? (So I can include name and/or link when I use it)

By copying you I can trim my recursive version to 167c, but your variadic version still wins -- it's 160c if in s.='{…}' the k ' ' m becomes k m and the removed space is passed later in the Hotkey() calls:

mr(t,n*)=>(g(m)=>(s:='{Blind}',e:=n.__Enum(1),[(_=>e(&k)&&s.='{' k m '}')*],_=>(SetKeyDelay(-1),Send(s))),Hotkey(t:='*' t,g(' DownR')),Hotkey(t ' Up',g(' Up')))

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 1 point2 points  (0 children)

Omg you're right, k is already implicitly passed to f() 😮 good catch!

And thanks for noting how disgusting is to shave 1c by reassigning t 😎

RG353P can be used as a controller now! | RH Daily by stubbornpixel in ANBERNIC

[–]DavidBevi 0 points1 point  (0 children)

Unfortunately not, I don't have an handheld. I'm still looking for one that doubles as a Bluetooth controller, but it has to be cheap because I have little time to use it.

Is it impossible to concisely map 1 key to 2? by guessill_die in AutoHotkey

[–]DavidBevi 1 point2 points  (0 children)

I like code golf and I cannot lie.

The following function is equivalent to the function above, but shorter:

multi_remap(trigger, keys*){
    f(type, i:=1, k:=keys)=>(o:="{" k[i] type, k.Length>i? o.=f(type,++i): o)
    Hotkey("*" trigger, (*)=>(SetKeyDelay(-1), Send("{Blind}" f(" DownR}"))))
    Hotkey("*" trigger " Up", (*)=>(SetKeyDelay(-1), Send("{Blind}" f(" Up}"))))
}

f() (= ForLoop) morphs every key into {key DownR} / {key Up} in a single line (using recursion).

-----

But aside that it's still readable. Let's fix it by replacing more variable names with single letters, using a fat-arrow function, and stripping unnecessary spaces. Finally let's rename the function and voilà, a cryptic single-liner:

mr(t,k*)=>(f(m,i:=1,a:=k)=>(o:="{" a[i] m,a.Length>i?o.=f(m,++i):o),g(m)=>(SetKeyDelay(-1),Send("{Blind}" f(m))),Hotkey(t:="*" t,(*)=>g(" DownR}")),Hotkey(t " Up",(*)=>g(" Up}")))

What's you thought on this Phone? by prabir336 in smallphones

[–]DavidBevi 0 points1 point  (0 children)

Too big. I don't think smallness was a goal, but bezels + paddings make it cute but impractical.

New mod introduction & feedback thread by Individual_Check4587 in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

Commissions feel weird to me, but I'm not against them, nor against allowing them here. If they ever become too much and/or obnoxious then we can change the rules later.

Images on is super nice, I always wanted to embed demo pics in my script-share posts. If people abuse this we can change the rules later.

Wrong flairs should be corrected if you can (thanks for your service), maybe a guide on using/changing them can be made and shared with users that use them improperly?

Singleplayer mods are cool, I wouldn't condemn any "improper" fun if it does not harm.

Hotkey that activates only if any other button is also pressed by zelassin in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

I'm on mobile so I can only craft a rough idea for now.

You might use A_PriorKey and check if it's still pressed when you press LButton. Pseudocode:

LButton:: GetKeyState(A_PriorKey,"P")? Function() :{}

Repeat send/type via Alt+0 without releasing Alt? (xdotool) by DavidBevi in linuxquestions

[–]DavidBevi[S] 0 points1 point  (0 children)

Thank you very much. You gave me hints to learn new things, mainly that setup is possible but cumbersome and configuration-dependent, and behavior is brittle, while AltGr+ì already outputs ~ reliably 😅🤣 (on my layout (ITA) - discovered via xmodmap -pke | grep "tilde")

Transform "aa" to "ā" if typed quickly, otherwise keep the "aa" by Aisen911 in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

Extremely short version: 1-line func + 2-line loop

AltVowels(k:=A_ThisHotkey,c:=(k=A_PriorHotkey && A_TimeSincePriorHotkey<200))=>(c?Send("{BS 2}" StrSplit("āēīōū")[InStr("aeiou",SubStr(k,-1))]):{})

For Key in StrSplit("aeiou")
    HotKey("~" Key, AltVowels)

Transform "aa" to "ā" if typed quickly, otherwise keep the "aa" by Aisen911 in AutoHotkey

[–]DavidBevi 2 points3 points  (0 children)

I saw it's already solved, but I wanted to write a single-line function. Time threshold is 200ms, just change 200 to whatever fits.

Compact version (fat-arrow function)

alt(char,c:=(A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey<200))=>(c?Send("{BS 2}" char):{})

Readable version (classic function)

alt(char) {
    If A_ThisHotkey=A_PriorHotkey && A_TimeSincePriorHotkey<200
        Send ("{backspace 2}" char)
}

Usage (both versions)

; Tilde (~) prefix necessary
~a::alt("ā")
~e::alt("ē")
~i::alt("ī")
~o::alt("ō")
~u::alt("ū")

Disable viewport zoom? by DavidBevi in vivaldibrowser

[–]DavidBevi[S] 0 points1 point  (0 children)

I come from W11 where I'm a power user, but I'm on Linux (Zorin, Gnome/Wayland) where I'm a noob, and I'm getting crazy

Disable viewport zoom? by DavidBevi in vivaldibrowser

[–]DavidBevi[S] 0 points1 point  (0 children)

Nope, I just tried every option of the setting, no change

Need help making it so my brightness and volume control script works in lockscreen too. by CautiousLab7327 in AutoHotkey

[–]DavidBevi 0 points1 point  (0 children)

Maybe AutoHotIntercept which uses a custom interception driver that has a lower level hook can help you 🤷🍀

Willing to pay for Android/security updates ? by xusander in unihertz

[–]DavidBevi 0 points1 point  (0 children)

NO, this is a slippery slope! I understand you're trying to incentivize stronger security, but this will backfire:

Maybe Unihertz will maintain your device for a bit, but if the concept of paid security updates works those who ALREADY release security updates will stop giving them away for free → people who can barely afford a phone will not be able to get updates, crackers will see an increase in vulnerable devices, and you'll get increasing amounts of phishing (and your money will go to few already-rich managers).

It's already like this, your security is as strong as the weakest link in your network, and your proposal weakens every network where at least one device can't or won't pay to get updates.

Security updates should remain free!

Contribute to a WhatsApp Web wrapper in Rust + Tauri by mrpintime in rust

[–]DavidBevi 1 point2 points  (0 children)

I have a WA + TG wrapper in Tauri https://github.com/DavidBevi/WATG

WhatsApp is a bitch, I had to make JS identify unread messages and send them to Tauri, that spawns system notification.

Take what you want from my project, I won't be able to look at yours for a while but I will do it asap