Show / Hide Table of Contents

WithKeyboard Method

WithKeyboard(KeyboardLayout)

Set the KeyboardLayout to use.

C#
public ConfigureStaticPassword WithKeyboard(KeyboardLayout keyboard)

Parameters

Type Name Description
KeyboardLayout keyboard

The keyboard layout to use for the static password.

Returns

ConfigureStaticPassword

The ConfigureStaticPassword instance

Exceptions

Type Condition
InvalidOperationException

Thrown if your password has characters that are not available in your selected KeyboardLayout.

Remarks

The YubiKey itself does not understand the concept of a keyboard layout. It only sends HID codes to the USB port. The keyboard layout is used at the operating system level to translate between the HID codes and actual characters.

For example, if you have an English, U.S. keyboard and press the [Y] button, an HID usage report with an ID of 0x1C is generated by your keyboard. This is converted by your operating system to whatever internal scheme it uses, then to the letter "Y".

However, if you program your key with a keyboard setting, but then someone uses the key on a system that has a German layout, the keyboard key that sends an HID usage ID of 0x1C is the [Z] key.

If you can be reasonably sure that your YubiKey will always be used on a system with the same keyboard layout, you can use this setting. However, Yubico's custom layout called ModHex is a reduced set that only includes mappings that are the same on most keyboard layouts.

In this article
Back to top Generated by DocFX