Skip to content

RawInput

Narta Xaymar Dirks edited this page Oct 30, 2026 · 1 revision

RawInput

RawInput:Void enable:Int32
Parameter Mode Type Default Description
enable In Int32 required 1 (True) to ask for the raw mouse, 0 (False) for the same as the original.

Description

Asks for the mouse as the hardware reports it, without the pointer acceleration and rounding of the system. It is off by default, which gives exactly what the original does.

With it on, MouseXSpeed and MouseYSpeed count the movement of the mouse itself, whatever the pointer settings of the system are, and keep the part of a pixel that is left over until the next call, so slow movements are not lost. It needs no MoveMouse to do this: the window keeps the pointer while the program asks for the speed and lets go about 300 milliseconds after the last time it did. MouseX and MouseY go on telling where the pointer would be. The wheel is counted by its fractions too: a wheel or touchpad that scrolls in small steps adds them up and MouseZ and MouseZSpeed change by one whenever a whole step is there. Joysticks and keyboards are not changed, as the system gives their values as they are anyway.

On a platform without a mouse that can be asked for like this (see HWRawInput) the setting is accepted and everything reports as it does with it off.

Differences

  • This is a BlitzLLVM extension: the original has no such command, and gets its mouse speed from DirectInput.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
RawInput True
Local x# = 160
While Not KeyHit(1)
	x = x + MouseXSpeed() ; Not accelerated, no MoveMouse needed.
	Cls
	Text 10, 10, "Move the mouse sideways, Escape ends"
	Oval x - 8, 110, 16, 16, 1
	Flip
Wend

Related Commands

DirectInputEnabled, EnableDirectInput, HWRawInput, RawInputEnabled

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally