Wie kann ich mit den Windows-Systemwerkzeugen den Alt-Schlüsselcode für eine Glyphe finden?

1319
XyberICE

Wie kann ich den Alt KeyCode einer bestimmten Glyphe (Sonderzeichen) mit einem Standardprogramm finden, das im Lieferumfang von Windows enthalten ist (oder einer Befehlszeilenanweisung?)?

Ich verstehe, könnte dies scheint wie ein Duplikat Suche Alt - Code für ein beliebiges Zeichen

Wie @ Tomáš in den Kommentaren zu @ Riks Beitrag feststellt, zeigt dies jedoch nicht den Alt-Schlüsselcode für alle Zeichen (insbesondere einige der nützlichsten, z. B. Pfeile, Smileys usw.).

1
Warum denken Sie, wenn zum Beispiel die Zeichentabelle keinen "Alt-Schlüsselcode" für das Zeichen enthält, das überhaupt existiert? a CVn vor 8 Jahren 0
Der beste Weg, um mit einer Situation umzugehen, in der eine fast identische Frage existiert, Sie jedoch eine etwas andere Richtung wollen, besteht darin, diese Frage mit einer Prämie zu belohnen, um darauf aufmerksam zu machen. Sie können dies tun, wenn Sie etwas Zeit in die Website investieren, um sich einen guten Ruf zu verdienen. Siehe den [Hilfe] Artikel [Was ist ein Kopfgeld? Wie kann ich eine starten?] (Https://superuser.com/help/bounty) a CVn vor 8 Jahren 0
http://www.alt-codes.net/ Moab vor 8 Jahren 0
http://usefulshortcuts.com/alt-codes JosefZ vor 8 Jahren 0
@ MichaelKjörling Weil ich es ausprobiert habe (selbst überprüfen, Rechtspfeil, Alt-026, nicht in der Zeichentabelle angezeigt) [Screenshot] (https://i.imgur.com/26ww08f.png) XyberICE vor 8 Jahren 0
@Moab Danke Jungs, aber ich versuche wirklich, eine Lösung mit integrierter Windows-Software herauszufinden. XyberICE vor 8 Jahren 0

1 Antwort auf die Frage

1
JosefZ

Vollständige Beschreibung der Windows Alt+ x-Codes

basierend auf Kurzdetails zu Alt-Codes (der beste Artikel, den ich bisher gesehen habe, obwohl er noch unvollständig ist).

Für eine gegebene (dezimal) Zahl x zwischen 1und 65535, sich ergebende Charakter Alt - Code ist immer abhängig von Bereich ( 1..31, 32..127, 128..255, 256..65535) und können, müssen aber nicht davon abhängen :

  • Zahlenformat, führende Präsenz von Nullen: Alt+ xgegenüber Alt+0x
  • Anwendung Unicode-Funktion:
    • Legacy (Code-Seite basiert, nicht-Unicode), zum Beispiel cmd, powershell, notepad, ...
    • Unicode, zB Wordpad ( write), Haftnotizen ( StikyNot), Suchfeld in explorer,…
  • Systemgebietsschema : Legt fest, welche ANSI-, OEM- und MAC-Codepages und die zugehörigen Bitmap-Schriftdateien als Standardwerte für das System verwendet werden.
  • Eingabegebietsschema, ein Paar, bestehend aus der Sprache, die ein Benutzer eingeben möchte, und der Eingabemethode (hier auf die Tastatur eingegrenzt):
    • Sprache;
    • Tastaturbelegung.

Bereichsspezifische Regeln - Alt+x

from    to Ergebnis : x- tes Zeichen aus……
  1     31Zeichenfolge ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼
 32    127… OEM / ANSI-Codepage (für alle Ländereinstellungen in diesem Bereich identisch)
128    255… OEM-Codepage-Standard für System Locale
256  65535 Legacy : obige Regeln gelten für x % 256(siehe Modulo-Operation )
           Unicode :… Unicode-Tabelle

Bereichsspezifische Regeln - Alt+0x

from      to Ergebnis : x- te Zeichen aus
  01     031…… Unicode-Tabelle (Steuerzeichen); Check Alt+ 09 Zeichentabula
 032    0127 ... ANSI / OEM - Codepage (identisch für alle locale in diesem Bereich)
0128    0255 Vermächtnis : ... ANSI - Codepage Standard für Tastatur - Layout, unabhängig von Sprache
             Unicode : ... ANSI - Codepage Standard für Sprache, unabhängig von Tastatur - Layout
0256  065535 Vermächtnis : apply oben genannte Regeln bis x % 256(einschließlich führende Null)
             Unicode :… Unicode-Tabelle (unabhängig von der führenden Null)

Ich habe die zuvor beschriebenen Regeln anhand der nächsten Eingabefelder (siehe test_Get-Culture.ps1unten stehendes Skript) gefunden und überprüft :

 Language L.tag KbdID Keyboard layout -------- ----- -------- --------------- English en-GB 00000809 United Kingdom English en-GB 00000405 Czech Czech cs 00000405 Czech Czech cs 00020409 United States-International Modern Greek el 00000408 Greek Russian ru 00000419 Russian Turkish tr 0000041F Turkish Q Turkish tr 00000426 Latvian Estonian et 0000041B Slovak Estonian et 0001041F Turkish F 

Etwas unpraktische Sprache und Tastaturlayout-Kombinationen, nicht wahr? Die oben genannten Regeln scheinen jedoch bereit zu sein, sie zu schreiben.

Alt KeyCode Finder

param([string[]] $InObject = @([char] 0x0)) Function GetAsciiCode ([char] $gacChar, [int] $gacCode) { if ($gacCode -le 0) { $gacAChar = [byte[]] 0 $gacPInto = [byte[]] 0 $gacPI437 = [byte[]] 0 } else { $gacEUnic = [System.Text.Encoding]::GetEncoding(1200) $gacET437 = [System.Text.Encoding]::GetEncoding(437) $gacETarg = [System.Text.Encoding]::GetEncoding($gacCode) $gacAChar = $gacEUnic.GetBytes($gacChar) $gacPInto = [system.text.encoding]::Convert($gacEUnic,$gacETarg,$gacAChar) $gacPFrom = [system.text.encoding]::Convert($gacETarg,$gacEUnic,$gacPInto) $gacPI437 = [system.text.encoding]::Convert($gacEUnic,$gacET437,$gacAChar) if ( -not ( $gacChar -eq $gacEUnic.GetString($gacPFrom) -or $gacPInto -le 31 ))  { $gacPInto = [byte[]] 0 } <# if ($gacChar -eq '§') { Write-Host "abc- " -NoNewline Write-Host $gacCode, AChar, $gacAChar, PInto, $gacPInto, PFrom, $gacPFrom, PI437, $gacPI437 -NoNewline Write-Host " -def" } #> } switch ($gacPInto.Count) { 2 { # double-byte character set (DBCS) recognized [int32] $gacPInNo = $gacPInto[1]+$gacPInto[0]*256 # [int32] $gacPInNo = 0 } 1 { # single-byte character set (SBCS) recognized [int32] $gacPInNo = $gacPInto[0] } default { [int32] $gacPInNo = 0 } } Return @($gacPInNo, $gacPI437[0]) }  <# language groups : https://msdn.microsoft.com/en-us/goglobal/bb688174 input method (IME): Get-WinUserLanguageList language examples : https://www.microsoft.com/resources/msdn/goglobal/default.mspx code pages & LCIDs: [System.Globalization.CultureInfo]::GetCultures( [System.Globalization.CultureTypes]::AllCultures)| Format-Custom -Property DisplayName, TextInfo #> $KbdLayouts = @( # Basic Collection (installed on all languages of the OS) @('0409', 437, 1252, 'en-US', 1, 'US & Western Eu'), @('0809', 850, 1252, 'en-GB', 1, 'US & Western Eu'), @('0405', 852, 1250, 'cs-CZ', 2, 'Central Europe'), @('0425', 775, 1257, 'et-EE', 3, 'Baltic'), @('0408', 737, 1253, 'el-GR', 4, 'Greek'), @('0419', 866, 1251, 'ru-RU', 5, 'Cyrillic'), @('041f', 857, 1254, 'tr-TR', 6, 'Turkic'), # East Asian collection: double-byte character sets (DBCS):  #@('0411', 0, 932, 'ja-JP', 7, 'Japanese'), # (Japan), DBCS #@('0412', 0, 949, 'ko-KR', 8, 'Korean'), # (Korea), DBCS #@('0404', 0, 950, 'zh-TW', 9, 'Trad. Chinese'),# (Taiwan), DBCS #@('0804', 0, 936, 'zh-CN', 10, 'Simpl.Chinese'),# (China), DBCS # Complex script collection (always installed on Arabic and Hebrew localized OSes)  @('041E', 0, 874, 'th-TH', 11, 'Thai'), # (Thailand) @('040D', 862, 1255, 'he-IL', 12, 'Hebrew'), # (Israel) @('0C01', 720, 1256, 'ar-EG', 13, 'Arabic'), # (Egypt) @('042A', 0, 1258, 'vi-VN', 14, 'Vietnamese'), # (Vietnam) # unknown supported code page #@('0445', 0, 0, 'bn-IN', 15, 'Indic'), # Bengali (India) #@('0437', 0, 0, 'ka-GE', 16, 'Georgian'), # (Georgia) #@('042B', 0, 0, 'hy-AM', 17, 'Armenian'), # (Armenia) @('0000', -1, -1, 'xx-xx', 99, 'dummy entry')) # (last array element - not used) #@(LCID, OEM-CP, ANSI-CP, IMEtxt, GroupNo, GroupTxt) $currentLocale = Get-WinSystemLocale $currentIME = "" -f $currentLocale.KeyboardLayoutId $currentOCP = (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage").OEMCP $currentACP = (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\CodePage").ACP $currentHead = 'IME ' + $currentIME + '/' + $currentLocale.Name +  "; CP" + $currentOCP + "; ANSI " + $currentACP $currHeadColor = "Cyan" $currCharColor = "Yellow" # write header $InObject Write-Host $(" " -f ` "Ch", "Unicode", "Alt?", "CP IME", "Alt", "Alt0") -NoNewline Write-Host $(" " -f $currentHead) -ForegroundColor $currHeadColor [string] $sX = '' for ($i = 0; $i -lt $InObject.Length ; $i++) { [char] $sAuX = [char] 0x0 [string] $sInX = $InObject[$i] if ($sInX -eq '') { [string] $sInX = [char] 0x00 } Try { [int] 0 + $sInX | Out-Null [char] $sAuX = $sInX | Invoke-Expression } Catch { [string] $sAuX = ''} #Finally {#$sInX += $sAuX } if ($sAuX -eq '') { $sX += $sInX } else { $sX += $sAuX } }  for ($i = 0; $i -lt $sX.Length ; $i++) { [char] $Ch = $sX.Substring($i,1) $ChInt = [int] $Ch $ChModulo = $ChInt%256 $altPDesc = "…$ChModulo…" Try {  # Get-CharInfo module downloadable from http://poshcode.org/5234 # to add it into the current session: use Import-Module cmdlet $Ch | Get-CharInfo |% { $ChUCode = $_.CodePoint $ChCtgry = $_.Category $ChDescr = $_.Description } } Catch { $ChUCode = "U+" -f $ChInt if ( $ChInt -le 0x1F -or ($ChInt -ge 0x7F -and $ChInt -le 0x9F))  { $ChCtgry = "Control" } else { $ChCtgry = "" } $ChDescr = "" } Finally { $ChOut = $Ch } $altPCode = "$ChInt" # possible Alt+ code  $altRCode = "" # effective Alt+ code $altRZero = "" # effective Alt+0 code if ( $ChCtgry -eq "Control" ) { # possibly non-printable character $ChOut = ''  $altPCode = "" if ($ChInt -gt 0) { $altRZero = "0$ChInt" }  } else { $ChOut = $Ch # supposedly printable character if ($ChInt -le 127) { $altRZero = "0$ChInt" $altRCode = "$ChInt" } } Write-Host "" # for better output readability? Write-Host (" " -f ` $ChOut, $ChUCode, $altPCode, $altPDesc, $altRCode, $altRZero) -NoNewline Write-Host (" " -f $ChDescr) -ForegroundColor $currCharColor $altRCode = "" if ($ChInt -gt 127) { for ($j = 0; $j -le ($KbdLayouts.Length -1) ; $j++) { $altPCode = "" $altRCode = "" $altRZero = "" [int] $ACP = $KbdLayouts[$j][2] # ANSI code page $aaCode = GetAsciiCode $Ch $ACP $xxCode = $aaCode[0] if ($xxCode -eq 0) {} else { $altRZero = "0$xxCode" } [int] $OCP = $KbdLayouts[$j][1] # OEM code page $ooCode = GetAsciiCode $Ch $OCP $yyCode = $ooCode[0] if ($yyCode -eq 0) { } else { $altPCode = "$yyCode" } if (($altPCode + $altRZero) -ne "") { # locale-dependent line $ChOut = "" $ChUCode = "" if ($OCP -le 0) { $altPDesc = '' # not valid OEM CP } else { $altPDesc = ('CP' + [string]$OCP) } $altPDesc += ($KbdLayouts[$j][3].PadLeft(6)) #if ($KbdLayouts[$j][0] -eq $currentIME -or $yyCode -le 128) { if ($OCP -eq [int]$currentOCP -or $yyCode -le 128) { if ($yyCode -eq $ooCode[1]) { $altRCode = $altPCode } } if ($ooCode[1] -ge 1 -and $ooCode[1] -le 31 -and $altRCode -eq "") { $altRCode = $ooCode[1] } if ($ACP -gt 0) { $alt0Desc = '(ANSI' + ([string]$ACP).PadLeft(5) +  ') ' + $KbdLayouts[$j][5].PadRight(16) } else { $alt0Desc = '' } if ($OCP -eq [int]$currentOCP -and $altRCode -eq "") { $altRCode = $altPCode } $line = " " -f ` $ChOut, $ChUCode, $altPCode, $altPDesc, $altRCode, $altRZero, $alt0Desc if ($OCP -eq [int]$currentOCP) { Write-Host $line -ForegroundColor $currHeadColor } else { Write-Host $line } }  } } } # write footer Write-Host `r`n($InObject -join ",") -ForegroundColor $currCharColor if ($sX -eq '') { # simple help $aux = $MyInvocation.InvocationName "Usage : $aux [<string>]`r`n" "Column : description of character base line" Write-Host " : -description of locale-dependent lines" -NoNewline Write-Host " (coloured for system defaults)" -ForegroundColor $currHeadColor "-------" "Ch : a character itself if printable" "Unicode: character code (Unicode notation)" "Alt? : character code (decimal) = Alt+ code if <=127 or > 255 (unicode apps)" " : -Alt+ code if following CP and IME corresponds to system default OEM-CP" "CP : -OEM code page corresponding to an input method" "IME : …character code modulo 256… (note surrounding ellipses)" " : -keyboard layout (input method) (text)" "Alt : -effective ALT+ code complying with system default OEM-CP request" "Alt0 : -effective ALT+0 code for an IME corresponding to ANSI-CP" Write-Host "IME : Unicode name of a character " -NoNewline Write-Host "(only if activated Get-CharInfo module)" -ForegroundColor $currCharColor " -(ANSI codepage) Laguage group name`r`n" #Write-Host "" } 

Gilt nicht für "Nur Unicode" -Sprachen wie Hindi und Georgisch.

Beispielausgabe : mycharmap 0xfd,ěìμм,291. Die meisten Zeichen, die ausgewählt wurden, um unterschiedliche Alt+ 0236Ergebnisse in verschiedenen Eingabegebietsschemas anzuzeigen.

Alt KeyCode Finder

Anhang1: mycharmap.batSkript:

@powershell Import-Module D:\PShell\Get-CharInfo_1.1.ps1;D:\PShell\SU\1024763.ps1 %* 

Anhang2: test_Get-Culture.ps1Skript:

### test_Get-Culture.ps1 ### " " -f "Language", "L.tag", "KbdID", "Keyboard layout" " " -f "--------", "-----", "--------", "---------------" $gcWULL = Get-WinUserLanguageList $gcWULL | ForEach-Object { $gcU=$_ $gcUIMT=$gcU.InputMethodTips  Write-Output $gcUIMT | ForEach-Object { $cLx=$_.Substring(5) $cLz=Get-Item -LiteralPath "HKLM:SYSTEM\CurrentControlSet\Control\Keyboard Layouts\$cLx" $cLy=$cLz.GetValue("Layout Text", $gcU.LanguageTag) " " -f ($gcU.EnglishName).Replace(' (1453-)',''), $gcU.LanguageTag, $cLx, $cLy } }