On Windows I miss the Linux functionality, that any existing character could be inserted by pressing Ctrl + Shift + u1234, where "1234" is a Unicode code of that character.
Some of the characters could be added by Alt codes (Alt + code on numeric keyboard), but the range of characters insertable by Alt codes is too limited. Unfortunately I haven't got a numeric keyboard and I'm really used to use Unicode character codes.
The only way how to use Unicode codes on Windows I've already found is in Microsoft Office, which comes with a built-in functionality 1234 + Alt + X (where 1234 stands for Unicode character code). But I want to use Unicode everywhere, not only in MS Office.
I've got a recommendation to AHK, which looks it could help me with my issue. I learned some basics of AHK and I also can make a huge (almost 1 GB) list of all Unicode characters and their codes, but I still haven't figured out yet, how to make this together into working script. Could somebody just point me at some script parts, which should I use to achieve my aim? Or just give me a push, where in tutorials I should search? or is there some already existing working script I could use?
Simulating Ctrl + Shift + Unicode on Windows
Simulating Ctrl + Shift + Unicode on Windows
Last edited by aleskva on 08 May 2017, 12:42, edited 1 time in total.
Re: Simulating Alt + Shift + Unicode on Windows
Nice idea, maybe something like this.
Cheers.
edit:
Integer check.
If you want to see what you are typing,
Code: Select all
^+u::
Input,n, L4,{esc}{space}{enter}
n:="0x" . n ; Edit
if n is integer
Send,% "{U+" n "}"
return
edit:
Integer check.
If you want to see what you are typing,
Code: Select all
^+u::
Input,n, V L4,{esc}{space}{enter}
n:="0x" . n
if n is integer
SendInput,% "{bs 4}{U+" n "}"
return
-
- Posts: 302
- Joined: 05 Feb 2017, 00:03
Re: Simulating Alt + Shift + Unicode on Windows
Maybe you could make a hotkey that allows to type a number and then send the Unicode character.
Looks like I'm a little slow.
Edit:
I forgot the 'u' part of the hotkey, Oops.
Code: Select all
^+u::
Input, num, L4,{Space}{Enter}
SetFormat, IntegerFast, Hex
Send {U+%num%}
Return
Edit:
I forgot the 'u' part of the hotkey, Oops.
Last edited by Nightwolf85 on 08 May 2017, 11:16, edited 1 time in total.
Re: Simulating Alt + Shift + Unicode on Windows
Wow, pretty much more simple than I thought. Both solutions work almost fine, just two catches there.
On Linux I press Ctrl + Shift, hold this combination and then I type "u1234". "u1234" are all visible. I can type 1-5 letters (but in 99% I use exactly 4 letters). After I release Ctrl + Shift, the code after "u" is processed to Unicode character (maybe I didn't write it correctly in my first post).
I use the Czech keyboard layout, which has 1-9 and 0 on top of keyboard to baehave as numbers only with Shift
On Linux I press Ctrl + Shift, hold this combination and then I type "u1234". "u1234" are all visible. I can type 1-5 letters (but in 99% I use exactly 4 letters). After I release Ctrl + Shift, the code after "u" is processed to Unicode character (maybe I didn't write it correctly in my first post).
I use the Czech keyboard layout, which has 1-9 and 0 on top of keyboard to baehave as numbers only with Shift
Last edited by aleskva on 08 May 2017, 14:52, edited 1 time in total.
-
- Posts: 302
- Joined: 05 Feb 2017, 00:03
Re: Simulating Alt + Shift + Unicode on Windows
In my version you didn't need the u at all, my bad. (I've since edited in the 'u' so the keypress is the same as Helgef's)aleskva wrote:Wow, pretty much more simple than I thought. Both solutions work almost fine, just one last catch.
On Linux I press Ctrl + Shift, hold this combination and then I type "u1234". "u1234" are all visible. I can type 1-5 letters (but in 99% I use exactly 4 letters). After I release Ctrl + Shift, the code after "u" is processed to Unicode character (maybe I didn't write it correctly in my first post).
In Helgef's version you would just press Ctrl+Shift+u, no need to hold anything, then when you press 4 numbers it would finish the input and send the unicode automatically. Or if you did less than 4 numbers you would need to press Space, Esc, Enter to finish the input and send the unicode.
Hope that helps understand what is happening.
Re: Simulating Alt + Shift + Unicode on Windows
I'm sure I made some mistake here, let me know.
Code: Select all
^+u::
SendInput,u
Hotkey,shift up,sf24,on
Hotkey,ctrl up,sf24,on
holding:=1
n:=""
while holding {
Send,{Ctrl up}{Ctrl shift}
Input,p, V L1,{esc}{space}{enter}{F24}
n.=p
}
Hotkey,shift up,sf24,off
Hotkey,ctrl up,sf24,off
b:="0x" . n
if b is integer
SendInput,% "{bs " strlen(n)+1 "}{U+" n "}"
return
esc::exitapp
sf24:
holding:=0
Send,{F24}
return
Re: Simulating Alt + Shift + Unicode on Windows
Yes, it makes AHK crash
Re: Simulating Alt + Shift + Unicode on Windows
Hmm, I didn't expect that... I'll investigate later.
Re: Simulating Alt + Shift + Unicode on Windows
That is awkward, but I don't know why it would crash. At least here, the modifiers are released so there is no recursion of the hotkeyHelgef wrote:Code: Select all
Send,{Ctrl up}{Ctrl shift}
Code: Select all
A2 01D i u 2.39 LControl
A0 02A i u 0.00 LShift
55 016 i d 0.00 u
55 016 i u 0.00 u
A2 01D i d 0.00 LControl
A0 02A i d 0.00 LShift
Code: Select all
^+u::
SendInput,u
Hotkey,shift up,sf24,on
Hotkey,ctrl up,sf24,on
holding:=1
n:=""
while holding {
ctr:=A_Index
Send,{Ctrl up}{shift up}
Input,p, V L1,{esc}{space}{enter}{F24}
n.=p
}
Hotkey,shift up,sf24,off
Hotkey,ctrl up,sf24,off
n:="0x" . n
if n is integer
SendInput,% "{bs " ctr "}{U+" n "}"
return
esc::exitapp
sf24:
holding:=0
Send,{F24}
return
Re: Simulating Ctrl + Shift + Unicode on Windows
Unfortunately none of them works for me
Re: Simulating Ctrl + Shift + Unicode on Windows
I have no other ideas for this specific way of doing it. I think the key combo+holding is quite awkward, I prefer the first version, some key combo + no holding, I might even keep that myself
Good luck
Good luck
Re: Simulating Ctrl + Shift + Unicode on Windows
I ended up with following script. I press Ctrl + Shift + u and release Ctrl and u. When holding Shift I write 1-5 letters and after pressing Ctrl again it will be processed:Helgef wrote:I have no other ideas for this specific way of doing it. I think the key combo+holding is quite awkward, I prefer the first version, some key combo + no holding, I might even keep that myself
Good luck
Code: Select all
^+u::
SendInput, u
Input, num, V L5,{LControl}{RControl}
SetFormat, IntegerFast, Hex
len:=strlen(num)+1
Send, {bs %len%}{U+%num%}
Return
Finally this solution is the best for me. I only miss following things or functionalities and hope they will be added to AHK soon:
Code: Select all
Input, num, V L5,{Shift Up} ; Shift Up is not working as ending key, Shift down or Shift is not working too
Code: Select all
SetKeyState, Control, Up ; or:
Send, {Control Up} ; not working for keys pressed physically
Code: Select all
^+u::
if ( GetKeyState("Control", "P") and GetKeyState("Shift", "P") ){
Send, {Control Up} ; make pressed ctrl not apply on whatever
ReverseNumpad ; make pressed shift not apply on numpad, but leave it applied to numbers over qwerty (Middle-European keyboard layout)
SendInput, u
Input, num, V L5,{Control Up}{Shift Up}
SetFormat, IntegerFast, Hex
len:=strlen(num)+1
Send, {bs %len%}{U+%num%}
ReverseNumpad ; back to normal state
}
Return