Windows Unicode Keyboard Input U+‹Hex›

HOME
Insert Unicode characters directly from your keyboard by typing their 1~5 digit hex code.

This little utility uses the free AutoHotKey program to insert Unicode characters into your documents.

 

U+2610

  π

U+3c0

  ÷

U+f7

 

U+221e

  ×

U+d7

  ©

U+a9

  ®

U+ae
It works exactly like Microsoft's utility BUT does so reliably and in any application.

Usage:

• Cursor to insertion point.
• Hold down Alt key.
• Punch + key.
• Type 1~5 digit hex code eg: 3a9
• Release Alt key.
• Unicode character is now inserted.
• Hit Esc key at any point to cancel out.
• Hit Backspace to delete last typed digit.
• Times out after 9s to prevent confusion.

Installation:

• Download and install AutoHotKey-2
     from https://www.autohotkey.com/
• Download my AutoHotKey-2 script
     from this webiste Alt+UniCode.zip
     (inspect script contents with Notepad)
• Put the script into   shell:startup\
     or for all users   shell:common startup\
• Create shortcut to script in   shell:start menu\
     or for all users   shell:common start menu\
• Now your script will start when Windows starts
     but to start it right now, just double click it.
     It shows up in your System Tray when running.

Note that shell:common startup will resolve to something like
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\
and shell:common start menu will resolve to something like
C:\ProgramData\Microsoft\Windows\Start Menu\

Achtung:

This utility allows you to insert dangerous invisible control codes just as easily
as normal visible characters; just 'cause you don't see any output don't mean
that you dudn't laid nothing down! Cancel with Esc whenever in doubt!

AutoHotKey conflicts with the otherwise useful Microsoft MouseKeys feature.
Work around this by toggling NumLock or just use the main keyboard numerals.

Here is the U+‹Hex› script:

#Requires AutoHotkey v2.0

;Alt+UniCode.ahk version 202312141918
;May contain bugs, use with caution!
;
;Synopsis:
; Works exactly like the MicroSoft utility
; but works for any program and any time.
; Inserts any Unicode character at current
; cursor position based upon hex code point
; commonly designated as for eg: U+20ac
;
;Installation:
; Download and install AutoHotKey-2
; from https://www.autohotkey.com/
; Put this script into   shell:startup
;  or for all users   shell:common startup
; Put shortcut to script in   shell:start menu
;  or for all users   shell:common start menu
;
;Usage:
; Cursor to insertion point.
; Hold down Alt key.
; Punch + key.
; Type 1~5 digit hex code eg: 3a9
; Release Alt key.
; Unicode character is now inserted.
; Hit Esc key at any point to cancel out.
; Hit Backspace to delete last typed digit.
; Times out after 9s to prevent confusion.
;
;Bugs:
; InputHook() fails alongside Microsoft MouseKeys.
; https://www.autohotkey.com/boards/viewtopic.php?f=14&t=123357
;
;Debug:
; Documentation https://www.autohotkey.com/docs/v2/lib/
; ToolTip GetKeyName(Format("vk{:x}sc{:x}", vk, sc)) " vk" vk " sc" sc
; MsgBox GetKeyName(Format("vk{:x}sc{:x}", vk, sc)) " vk" vk " sc" sc
; NumLock On: 0vk96sc82 1vk97sc79 2vk98sc80 3vk99sc81 4vk100sc75 5vk101sc76 6vk102sc77 7vk103sc71 8vk104sc72 9vk105sc73 +vk107sc78 Entervk13sc284
; NumLock Off: 0vk45sc82 1vk35sc79 2vk40sc80 3vk34sc81 4vk37sc75 5vk12sc76 6vk39sc77 7vk36sc71 8vk38sc72 9vk33sc73 +vk107sc78 Entervk13sc284
; Main keys: 0vk48sc11 1vk49sc2 2vk50sc3 3vk51sc4 4vk52sc5 5vk53sc6 6vk54sc7 7vk55sc8 8vk56sc9 9vk57sc10
; Main keys: aAvk65sc30 bBvk66sc48 cCvk67sc46 dDvk68sc32 eEvk69sc18 fFvk70sc33 Spacevk32sc57 =+vk187sc13
; Main keys: AltRvk165sc312 AltLvk164sc56 Escvk27sc1 Entervk13sc28 Backspacevk8sc14

!NumpadAdd::
!+::
!=:: {

ih := InputHook("L0 T9","{Space}{Enter}{Escape}")
ih.VisibleNonText := False
ih.KeyOpt("{All}", "+I +N")
ih.OnKeyDown := KeyDown
ih.OnKeyUp := KeyUp
buffer := ""
ToolTip "{U+" buffer "}"
ih.Start()
ih.Wait()
   SetTimer ToolTip, -3000
   if ih.EndReason = "Timeout" || ih.EndKey = "Escape" || buffer = ""
      return
Send "{U+" buffer "}"
   return

KeyDown(ih, vk, sc) {
   if vk > 47 && vk < 58 ; Numbers
      buffer .= vk-48
   else if vk > 64 && vk < 71 ; Letters
      buffer .= GetKeyName(Format("vk{:x}sc{:x}", vk, sc))
   else if vk > 95 && vk < 106 ; NumLock 0~9
      buffer .= vk-96
   else if vk = 45 ; NumPad Ins
      buffer .= 0
   else if vk = 35 ; NumPad End
      buffer .= 1
   else if vk = 40 ; NumPad Down
      buffer .= 2
   else if vk = 34 ; NumPad PgDn
      buffer .= 3
   else if vk = 37 ; NumPad Left
      buffer .= 4
   else if vk = 12 ; NumPad "5"
      buffer .= 5
   else if vk = 39 ; NumPad Right
      buffer .= 6
   else if vk = 36 ; NumPad Home
      buffer .= 7
   else if vk = 38 ; NumPad Up
      buffer .= 8
   else if vk = 33 ; NumPad PgUp
      buffer .= 9
   else if vk = 8 ; Backspace
      buffer := SubStr(buffer, 1, StrLen(buffer)-1)
   else {
      MsgBox "Illegal Keystroke.`nAllowed entries are: `n`n0 1 2 3 4 5 6 7 8 9`nA B C D E F`na b c d e f"
      Return
   }
   ToolTip "U+" buffer
   if StrLen(buffer) > 4
      ih.Stop()
}

KeyUp(ih, vk, sc) {
   if (vk = 164 || vk = 165)
      ih.Stop() ; Alt key released
}
     }

The registry entry cited in the footnote of the above document is only necessary when using Microsoft's unreliable Alt+‹Hex‪› utility.

Safety, accuracy and completeness of information provided herein is not guaranteed,
so be inspired by it but do not use it as a basis for experimentation or other actions.

Clickable link!  TOP  ©™
 HOME 
Valid HTML & CSS!
Congrenation.com 2024-11-21T06:57:25.020Z
Version 20231217