How to make a symbol selector Topic is solved
-
- Posts: 14
- Joined: 22 Feb 2023, 11:28
How to make a symbol selector
There are a lot of symbols that aren't included on the keyboard by default, so I wanna make a script that lets you open a window with clickable symbols (stored in a variable inside the script), so when I click one of them, it's automatically pasted as if it was the clipboard, If pasting is too complicated then I'd like to at least copy the symbol to the clipboard.
Re: How to make a symbol selector
You can try QAP (Quick Access Popup), a program written in AHK. It allows you to quickly create menus that can paste symbols, text, etc...
https://www.quickaccesspopup.com/tag/sn ... %20Snippet.Snippets are pieces of text that you can paste into the active application using the QAP popup menu, hotstrings or shortcuts. Text snippets can contain characters, end-of-lines, and tabs.
-
- Posts: 14
- Joined: 22 Feb 2023, 11:28
Re: How to make a symbol selector
Thanks a lot, that seems really usefulXMCQCX wrote: ↑20 Mar 2024, 16:28You can try QAP (Quick Access Popup), a program written in AHK. It allows you to quickly create menus that can paste symbols, text, etc...
https://www.quickaccesspopup.com/tag/sn ... %20Snippet.Snippets are pieces of text that you can paste into the active application using the QAP popup menu, hotstrings or shortcuts. Text snippets can contain characters, end-of-lines, and tabs.
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to make a symbol selector Topic is solved
Save with UTF-8 with BOM
see here for more: https://copypastecharacter.com/all-characters
Code: Select all
#Requires AutoHotkey v2.0
SetKeyDelay 0
OnMessage(0x200, WM_MOUSEMOVE)
h:= 24, w := 26.5, v := 12 ; height & width for each symbol; v is number of symbols per row.
MyArr := ["ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔŒÕÖØÙÚÛÜßàáâãäåæçèéêëìíîïñòóôœõöøùúûüÿ"
,"≈∝≡≠≤≥×·÷∂′″∇‰°∴ø∈∩∪⊂⊃⊆⊇¬∧∨∃∀⇒⇔→↔↑ℵ∉°✓¿¡«»§¶†‡•-–—™©®¢€¥£₤¤√−±∞►◄"
,"αβγδεζηθικλμνξοπρσςτυφχψωΓΔΘΛΞΠΣΦΨΩ∫∑∏"
,"₀₁₂₃₄₅₆₇₈₉⁰¹²³⁴⁵⁶⁷⁸⁹✔✓❌❎✕✖✗✘❓❔❕❗⏰⌚⌛⏳♡⚡☹☝☠⛄⛅⚪⚫⏺⚬⛔⏸☂☔¼½⅔¾⅞♠♣♦♥☏"
,"─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳╴╵╶╷╸╹╺╻╼╽╾╿"
,"▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟"]
MyGui := Gui("-caption AlwaysOnTop +E0x08000000")
MyGui.Title := "Symbols"
MyGui.SetFont("s12")
MyGui.MarginX := MyGui.MarginY := 0
MyTab := MyGui.Add("Tab3","-Wrap", ["ú","⊆","Ω","½","╣","▙"])
loop MyArr.length
{
MyTab.UseTab(a_index)
for a,b in strsplit(MyArr[a_index])
MyGui.add("text","x" mod((a-1),v)*w " y" floor((a-1)/v)*h+35 " w" w " h" h " center",b).onevent("click",(ctrl,*)=>send(ctrl.value))
}
MyGui.show() ; MyGui.show("noactivate")
return
esc:: MyGui.hide
f12:: MyGui.show
WM_MOUSEMOVE(wparam, *)
{
if (wparam = 1) ; so Left Mouse Buttom can Drag Window
PostMessage 0xA1, 2,,, "Symbols" ; WM_NCLBUTTONDOWN
}
14.3 & 1.3.7
Re: How to make a symbol selector
This is my new favorite thing!!! ↑flyingDman wrote: ↑20 Mar 2024, 22:36Save with UTF-8 with BOMsee here for more: https://copypastecharacter.com/all-charactersCode: Select all
#Requires AutoHotkey v2.0 SetKeyDelay 0 OnMessage(0x200, WM_MOUSEMOVE) h:= 24, w := 26.5, v := 12 ; height & width for each symbol; v is number of symbols per row. MyArr := ["ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔŒÕÖØÙÚÛÜßàáâãäåæçèéêëìíîïñòóôœõöøùúûüÿ" ,"≈∝≡≠≤≥×·÷∂′″∇‰°∴ø∈∩∪⊂⊃⊆⊇¬∧∨∃∀⇒⇔→↔↑ℵ∉°✓¿¡«»§¶†‡•-–—™©®¢€¥£₤¤√−±∞►◄" ,"αβγδεζηθικλμνξοπρσςτυφχψωΓΔΘΛΞΠΣΦΨΩ∫∑∏" ,"₀₁₂₃₄₅₆₇₈₉⁰¹²³⁴⁵⁶⁷⁸⁹✔✓❌❎✕✖✗✘❓❔❕❗⏰⌚⌛⏳♡⚡☹☝☠⛄⛅⚪⚫⏺⚬⛔⏸☂☔¼½⅔¾⅞♠♣♦♥☏" ,"─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳╴╵╶╷╸╹╺╻╼╽╾╿" ,"▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟"] MyGui := Gui("-caption AlwaysOnTop +E0x08000000") MyGui.Title := "Symbols" MyGui.SetFont("s12") MyGui.MarginX := MyGui.MarginY := 0 MyTab := MyGui.Add("Tab3","-Wrap", ["ú","⊆","Ω","½","╣","▙"]) loop MyArr.length { MyTab.UseTab(a_index) for a,b in strsplit(MyArr[a_index]) MyGui.add("text","x" mod((a-1),v)*w " y" floor((a-1)/v)*h+35 " w" w " h" h " center",b).onevent("click",(ctrl,*)=>send(ctrl.value)) } MyGui.show() ; MyGui.show("noactivate") return esc:: MyGui.hide f12:: MyGui.show WM_MOUSEMOVE(wparam, *) { if (wparam = 1) ; so Left Mouse Buttom can Drag Window PostMessage 0xA1, 2,,, "Symbols" ; WM_NCLBUTTONDOWN }
ste(phen|ve) kunkel
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to make a symbol selector
14.3 & 1.3.7
Re: How to make a symbol selector
Thanks for this!
Saved as instructed... some symbols are still just generic blocks (placeholders). Is there a way to fix this?
This is Win7, if that makes a difference.
Re: How to make a symbol selector
What displays depends on what font you have selected.
Russ
Russ
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to make a symbol selector
Did a simple copy/paste from code window. The characters in code window display fine, but once pasted, the characters are blocks as shown in the image. This also happens if I first create a new doc in Notepad++ and make it UTF-8 BOM prior to pasting. Also tried saving the code as a file using download button, and get same results. And if I copy, then paste as if I am posting a reply here, it is pasted correctly. So it's not related to clipboard either. Might be a Win7 thing.
Update... ok... I don't know what happened, but now the characters look fine in the Scite code window, but still don't display correctly in the GUI window. Do I need to set a font for the GUI? Is this what you mean by "what font you have selected"?
Tested on Win 10, and works fine, so must be related to how Win7 displays fonts in the AHK Gui's? Maybe there is a way to adjust that. But my search has not been fruitful yet.
If you feel I should try something else, I will give it a shot.
BTW... I changed the width to this so the tabs will adjust to screen resolution
w := 33/(A_ScreenDPI/96)
Thanks!
Andy
Re: How to make a symbol selector
Code: Select all
#Requires AutoHotkey v2.0 64-bit
#SingleInstance Force
Symbols := [
["∙","•","●","○","■","□","◆","◇","★","☆"],
["▶","▷","▲","△","▼","▽","◀","◁","♡","♥"],
["※","±","㎡","〈〉","「」","『』","【】","","", ""],
["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩"],
["⑪","⑫","⑬","⑭","⑮","←","↑","↓","→",""]
]
MyGui := Gui(,"Symbols")
MyGui.Opt("AlwaysOnTop")
YY:=10
loop 5
{
HH := A_Index
XX := 10
loop 10
{
RR := A_Index
MyGui.Add("Button", "w30 X" XX " Y" YY, Symbols[HH][RR]).OnEvent("Click", OKClick)
XX := XX + 30
}
YY := YY + 22
}
MyGui.Show("Hide")
OKClick(Btn, info)
{
MyGui.hide
if Btn.text = "〈〉" or Btn.text = "「」" or Btn.text ="『』" or Btn.text ="【】"
Send Btn.text "{left 1}{space 2}{left 1}"
else if Btn.Text
Send Btn.text "{space}"
sleep 50
MyGui.Restore
}
^NumpadMult::
{
MyGui.Show()
WinSetTransparent 220, "Symbols"
}
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to make a symbol selector
... I am afraid it is. (it also works fine on an older Win 10 PC and no DPI adjustments were needed)
14.3 & 1.3.7
- flyingDman
- Posts: 2817
- Joined: 29 Sep 2013, 19:01
Re: How to make a symbol selector
@jinok I like the open and closing brackets with 2 spaces!
Note: if you include the +E0x08000000 in the gui options you can remove the MyGui.hide and MyGui.restore and the gui will not flicker. +E0x08000000 allows you send to the window below the script's window.
Note: if you include the +E0x08000000 in the gui options you can remove the MyGui.hide and MyGui.restore and the gui will not flicker. +E0x08000000 allows you send to the window below the script's window.
14.3 & 1.3.7