FreeDOS MODE CON RATE/DELAY: Typematic Input Without Guesswork
Tune FreeDOS keyboard repeat timing with MODE CON RATE and DELAY, understand BIOS support boundaries, and verify behavior without changing keyboard layout.
FreeDOS MODE CON RATE and DELAY configure keyboard typematic behavior: how long a key is held before repeating and how quickly repeats arrive while the key remains down. They do not change the keyboard layout, code page, key mapping table, or application input loop. The FreeDOS MODE help documents a user-facing rate range from 1 to 32, corresponding to approximately 2 to 30 characters per second, and a delay range from 1 to 4 in quarter-second units.
The values are translated through BIOS-compatible keyboard services. BIOS support varies by machine and firmware; the related INT 16h service is documented for AT and PS/2 compatible systems, not every original PC-class system. A DOS prompt accepting a MODE command is not proof that the physical keyboard controller applied the requested value. Test on the target machine and keep a usable default profile.
Separate repeat timing from layout and text encoding
Typematic behavior is the repeated generation of a held key after an initial delay. It affects interactive typing and some programs that poll or read keyboard input, but it does not make a different scan code become a different character. Layout and character interpretation are controlled elsewhere, including keyboard drivers, BIOS translation, DOS code pages, and the program’s own input logic.
If the symptom is that a key produces the wrong letter, troubleshoot KEYB, code-page configuration, and the keyboard interface rather than raising RATE. If a key repeats too slowly or too quickly when held at the DOS prompt, RATE and DELAY are relevant. If a program ignores repeated keys, inspect its input loop and BIOS/DOS input calls; a host setting cannot force an application to consume events it does not read.
The distinction is particularly important when reproducing a bug. Record layout, active code page, keyboard driver, BIOS or emulator, MODE settings, and the application. Otherwise, two machines with the same RATE value can still behave differently because the translation stack or the program differs.
FreeDOS MODE values and BIOS values
The FreeDOS command reference documents MODE CON[:] RATE=value and DELAY=value. It lists a rate range of 1 through 32 with approximate repeat rates of 2 to 30 characters per second and delay values 1 through 4 with a unit of 0.25 seconds. The help page lists defaults of rate 20 and delay 1; treat these as documented FreeDOS command defaults, not a universal hardware default for every BIOS or keyboard.
The BIOS interface uses different encodings. RBIL documents INT 16h AH=03h, AL=05h for setting the repeat rate and delay on AT/PS/2 systems: BH carries a delay code from 0 to 3, while BL carries a repeat-rate code from 0 through 1Fh; those encodings run from about 30 repeats per second down to 2. The user-facing MODE scale should not be copied directly into those BIOS registers. FreeDOS performs its own translation, and the mapping should be taken from the source for the exact MODE build if software needs to reproduce it.
The BIOS service has support constraints and can destroy register values documented by RBIL. A custom program that invokes it directly must check the appropriate keyboard service support query first and preserve the registers its calling convention requires. For an operator, prefer MODE’s documented interface over hand-coded port writes or guessed BIOS parameters.
Apply a controlled setting
Check the installed utility’s syntax and then change only the repeat parameters:
mode con rate=10 delay=2
The values in this example are within the documented MODE ranges. It does not promise a precise physical repeat frequency on every keyboard; the BIOS and device map the requested setting to supported steps. Hold a key briefly at the prompt and then for longer to observe the initial delay and repeat cadence. Avoid holding a key in a command line that could execute or erase data.
If behavior becomes worse, restore the profile’s documented defaults or reboot to a known configuration. The FreeDOS help lists defaults of RATE 20 and DELAY 1. An explicit command may be used to return to those values, but validate in the target shell that the installed MODE build accepts and applies them:
mode con rate=20 delay=1
Do not set a very fast repeat rate while a user is entering destructive commands or while an application has an unsafe key-repeat action. The system does not understand the semantic risk of repeated keystrokes; it simply configures the timing request.
Measure the behavior with a repeatable test instead of relying on subjective feel. At a plain prompt, hold a harmless character key for a measured interval, count repeats after the initial delay, and repeat with the alternative setting. Avoid sending repeated characters into a command that could execute. Note the keyboard, machine or emulator, BIOS identity, and whether a resident keyboard utility is loaded. This yields a useful comparison even when hardware rounds requests to supported steps.
Diagnose the result
If MODE prints an error or the setting appears unchanged, consult the exact MODE help and exit status rather than assuming the command was applied. Verify that the command targets CON, not COM or LPT. Check whether the system is running in a VM, remote console, USB keyboard emulation layer, or firmware mode that does not expose the expected BIOS typematic service.
Test from a plain DOS prompt first, then compare with the application. If the prompt repeats correctly but an application does not, that points toward the application’s keyboard-read strategy or event handling, not necessarily MODE. If the prompt itself behaves differently after a reboot, check whether the setting was placed in the active startup profile and whether a later driver resets it.
Do not confuse typematic timing with keyboard buffering. BIOS keyboard buffer occupancy, enhanced-key handling, scan-code translation, and repeat behavior are separate concerns. A full buffer can lose or delay input even if typematic rate is correct. Likewise, a PS/2 controller or USB legacy-emulation issue is not fixed by changing RATE if the host never delivers the expected BIOS event.
Automation and repeatability
For a managed machine, place a tested MODE command in the active AUTOEXEC.BAT or FDAUTO.BAT only if a consistent setting is required across reboots. Keep the command after any configuration that might replace the console or keyboard behavior. Record why the value differs from the FreeDOS documented defaults and how users can restore it.
Do not apply a setting to all systems solely because it felt better on one keyboard. Different BIOSes expose different repeat intervals, and the MODE scale is an abstraction over those facilities. Establish acceptance on representative hardware and an emulator separately. Use measurable observation: count repeat events over a fixed hold interval and record the initial delay, rather than judging from memory.
Test cold boot, warm boot, and the rescue profile if they use different drivers. Firmware may establish a default during initialization, while a later startup command can override it. If the value changes unexpectedly, compare the startup sequence and resident drivers before concluding that the keyboard or BIOS ignores MODE. Retain a recovery profile with the documented default values.
Practical acceptance checks
Confirm the active FreeDOS MODE binary, the exact command line, the intended console, and whether startup scripts reapply a different value. Verify that a short tap still produces one character and a sustained hold repeats only after the expected delay. Test normal typing in the target application and confirm that layout and code-page output have not changed.
The host used for this article has no physical AT keyboard or FreeDOS BIOS on which to test typematic timing. The commands and register details are source-grounded but require runtime verification on the target hardware or DOS emulator. Keep a recovery boot profile with the default setting available.
MODE’s typematic controls are a narrow input-timing tool. Use them for repeat cadence symptoms, keep layout and buffer diagnosis separate, and respect the BIOS support boundary instead of assuming a numeric value means identical timing on every DOS machine.
Related:
- DOS BIOS Keyboard Input: INT 16h, Buffer Semantics, and Enhanced Keys
- The PC/AT 8042 Keyboard Controller: Status, Buffers, and Safe Ownership
Sources: