Skip to content
Cameron Rye edited this page Nov 19, 2025 · 1 revision

Usage Guide

Learn how to use DosKit effectively.

Basic Usage

The simplest way to use DosKit is to run the development server:

npm run dev

This will start a DOS prompt that you can interact with directly in your browser at http://localhost:5173.

Interacting with the DOS Prompt

Once the emulator loads, you'll see a DOS command prompt. You can:

  • Type DOS commands - dir, cd, cls, etc.
  • Run programs - Navigate to directories and execute .exe or .com files
  • Use keyboard shortcuts - Function keys, Ctrl combinations, etc.

Loading Applications

Using the Application Selector

  1. Click the menu button or press Ctrl+O
  2. Browse available DOS applications
  3. Click on an application to load it
  4. Wait for files to download and initialize
  5. The application will start automatically

Using Deep Links

Load specific applications directly via URL:

http://localhost:5173/?app=secondreality
http://localhost:5173/?app=impulsetracker

Features:

  • URLs automatically update when you select an app
  • Bookmarkable - save direct links to your favorite applications
  • Browser navigation works (back/forward buttons)
  • Refresh-safe - page refreshes maintain the loaded application

Keyboard Controls

Standard DOS Keys

  • Function Keys: F1-F12
  • Arrow Keys: Navigation
  • Enter: Execute command
  • Escape: Cancel/Exit
  • Tab: Auto-complete (in some applications)
  • Ctrl+C: Interrupt program
  • Ctrl+Break: Break execution

Emulator Controls

  • F11: Toggle fullscreen
  • Ctrl+F10: Release mouse capture
  • Ctrl+F12: Speed up emulation
  • Ctrl+F11: Slow down emulation

Audio Controls

Audio is automatically unmuted when the emulator is ready. You can:

  • Adjust volume in your browser tab
  • Mute/unmute via browser controls
  • Configure volume in the emulator settings

Mobile Usage

On mobile devices, DosKit provides:

  • On-screen keyboard - Touch-friendly keyboard with common DOS keys
  • Touch controls - Tap to interact
  • Landscape mode - Optimized for landscape orientation
  • Pinch to zoom - Zoom in/out on the screen

Mobile Tips

  • Use landscape orientation for better experience
  • Tap the keyboard icon to show/hide on-screen keyboard
  • Use two-finger tap for right-click
  • Swipe to scroll in applications that support it

Adding Your Own DOS Applications

To run your own DOS applications or games:

1. Create a Configuration File

Create a new file in src/dos-apps/:

// src/dos-apps/my-app.config.ts
import type { DosApp } from '../types/dos-app';

export const myApp: DosApp = {
  id: 'my-app',
  name: 'My DOS Application',
  description: 'Description of my app',
  loader: async () => {
    // Load your files here
    return {
      'myapp.exe': await fetch('/apps/myapp.exe').then(r => r.arrayBuffer()),
    };
  },
  dosboxConf: `
    [autoexec]
    @echo off
    mount c .
    c:
    myapp.exe
  `,
};

2. Place Files in Public Directory

Put your DOS files in public/apps/:

public/
└── apps/
    └── myapp/
        ├── myapp.exe
        ├── data.dat
        └── config.cfg

3. Register the Application

Add your app to the application registry in src/dos-apps/index.ts.

Programmatic Control

Access the Command Interface for programmatic control:

import { useState } from 'react';
import { DosPlayer } from './components/DosPlayer';
import type { CommandInterface } from './types/js-dos';

function MyApp() {
  const [ci, setCi] = useState<CommandInterface | null>(null);

  const handleReady = (commandInterface: CommandInterface) => {
    setCi(commandInterface);
    
    // Now you can control DOS programmatically
    commandInterface.simulateKeyPress(13); // Press Enter
  };

  return <DosPlayer onReady={handleReady} />;
}

Available Commands

  • ci.pause() / ci.resume() - Control emulation
  • ci.mute() / ci.unmute() - Audio control
  • ci.screenshot() - Capture screen
  • ci.fsReadFile() / ci.fsWriteFile() - File system access
  • ci.save() / ci.load() - Save/load state

See API Documentation for complete API reference.

Next Steps


Made with ❤️ by Cameron Rye

Clone this wiki locally