User Tools

Site Tools


characterresources

This is an old revision of the document!


Character Resources

When you press a key on the Twiddler, or any physical USB keyboard for that matter, it doesn't send the letter “A” or a Unicode character directly to the computer. Instead, it initiates a two-part translation process.

The fundamental difference lies in where the data is handled and what that data represents: USB HID Scan Codes are hardware-level, layout-agnostic position indicators sent by the keyboard, while Host-Side Character Encoding is software-level interpretation that turns those positions into meaningful text.

USB HID Keyboard Scan Codes (The Twiddler4 Level)

A USB HID (Human Interface Device) Scan Code is a raw, numerical value that the Twiddler sends to the host computer to report the physical press or release of a key.

  • Location: Generated on the Twiddler's internal microcontroller and transmitted over the USB bus.
  • Nature: It is entirely layout-agnostic and represents physical location rather than a specific character.
  • How it works: Under the USB HID standard, every key on a standard keyboard matrix is assigned a fixed hex value. For example, the physical key located to the right of the Caps Lock key always sends the scan code 0x04.
  • The catch: The keyboard hardware has absolutely no idea whether you are typing in English, French, or Japanese. It simply reports: “The key at position 0x04 has been pressed.”

Host-Side Character Encoding (The Operating System Level)

Host-Side Character Encoding is the final step in the software chain where numerical values are translated into specific visual characters (like “A”, “\n”, or “€”) based on digital standards like ASCII, UTF-8, or UTF-16.

  • Location: Handled entirely by the Host Operating System (Windows, macOS, Linux) and the active application.
  • Nature: It is context-dependent and relies heavily on the operating system's active Keyboard Layout (e.g., QWERTY, AZERTY, Dvorak) and the application's encoding configuration.
  • How it works: The OS receives the raw scan code, checks the active language layout, maps it to a virtual key, and then converts it into a character code (such as Unicode U+0061 for a lowercase “a”).

Extended Characters

Typing extended characters (like accented letters, currency symbols, or em dashes) on a Twiddler depends entirely on the operating system you are plugging it into. Because standard keyboards only have about 104 keys, operating systems use different software tricks to map the rest of the world's characters.

Here is how to type extended characters across the major platforms.

Windows: "Alt-Keypad"

Windows gives you two primary ways to type extended characters: using numeric codes or switching your keyboard layout.

Alt Codes (Requires the <keypad> Tag)

Windows uses the Windows-1252 character set. You can use Alt codes with the Twiddler.

  1. Check out https://www.gaijin.at/en/infos/ascii-ansi-character-table. Find the extended character you want to type in the 1st column.
  2. Note its decimal number in the 2nd column.
  3. In Twiddler Tuner add the opening Left Alt <lAlt>, 4 x Keypad <KPx>, and closing Left Alt </LAlt> tags.
¢ (Cent sign)

Decimal 162 = <LAlt><KP0><KP1><KP6><KP2></LAlt>

° (Degree symbol)

Decimal 176 = <LAlt><KP0><KP1><KP7><KP6></LAlt>

é (e with acute accent)

Decimal 233 = <LAlt><KP0><KP2><KP3><KP3></LAlt>

— (Em dash)

Decimal 151 = <LAlt><KP0><KP1><KP5><KP1></LAlt>

macOS: Intuitive Accent Menus and Modifiers

Mac makes typing extended characters incredibly seamless, regardless of the physical keyboard layout.

Option Key Shortcuts

Instead of Left Shift, the Option key is your primary modifier. macOS also has build in “dead-key combos” that make typing extended characters easy.

™

To type the Trademark symbol (™) on a Mac using the macOS “Unicode Hex Input” keyboard method, you need its 4-digit hexadecimal Unicode value, which is 2122.

Because the Mac requires literal hex characters (`A` through `F` are sent as standard keycodes rather than numeric keypad codes), you use standard key scan codes inside the Option tags.

Following the Mac UTF layout syntax, the encoding is:

`<LOption><Key2><Key1><Key2><Key2></LOption>`

—

### Quick Breakdown:

* `<LOption>`: Holds down the Left Option key to signal hex code entry. * `<Key2><Key1><Key2><Key2>`: Sends the literal sequence for `2`, `1`, `2`, `2`. * `</LOption>`: Releases the Left Option key, prompting macOS to interpret the code point and output ™.

### A Quick Note on Mac Layouts

If you aren't using the *Unicode Hex Input* source mode and are just using the standard *U.S. English* layout on a Mac, macOS actually maps the trademark symbol directly to a physical keyboard shortcut: Option + 2.

If your Twiddler configuration allows for standard modifier-key combos without entering explicit hex modes, you could also achieve it natively with a much shorter sequence:

`<LOption><Key2></LOption>`

* Option + G = © * Option + Shift + Hyphen (-) = — (Em dash)

For accents, use Option + [Accent Key], release them, then type the letter:

* Option + e, then e = é * Option + i, then o = ô

—

## 3. Linux: The Compose Key

In Linux environments (like Ubuntu or Mint), the most efficient way to type extended characters without a numpad is by defining a Compose Key in your keyboard settings (often mapped to the `Right Alt`, `Caps Lock`, or `Scroll Lock` key).

Once mapped, you press and release the Compose key, followed by two characters that logically combine into the extended character:

* Compose $\rightarrow$ ' $\rightarrow$ e = é * Compose $\rightarrow$ c $\rightarrow$ o = © * Compose $\rightarrow$ ~ $\rightarrow$ n = ñ * Compose $\rightarrow$ - $\rightarrow$ - $\rightarrow$ - = —

—

## 4. The Universal OS Fallback: Character Maps

If you only need a specific symbol occasionally and don't want to memorize codes, both main OS platforms have built-in visual Pickers:

* Windows: Press Windows Key + Period (.) to open the Emoji and Symbol picker. Navigate to the `Ω` (Symbols) tab. * macOS: Press Control + Command + Spacebar to bring up the Character Viewer.

characterresources.1780345639.txt.gz · Last modified: by tony