system
system
¶
Small platform queries and actions.
The OS name and processor count, clipboard read and write, opening a URL in the browser, and battery and power info. These are thin wrappers over SDL3.
getOS ¶
proc getOS(): string
The name of the operating system, like "macOS", "Linux" or "Windows".
Returns
string
Source:
src/nim2d/system.nim:8
getProcessorCount ¶
proc getProcessorCount(): int
getClipboardText ¶
proc getClipboardText(): string
The current clipboard text, or an empty string if there is none.
Returns
string
Source:
src/nim2d/system.nim:16
setClipboardText ¶
proc setClipboardText(text: string)
hasClipboardText ¶
proc hasClipboardText(): bool
openURL ¶
proc openURL(url: string): bool
Open a URL in the default browser. Returns false on failure.
Parameters
-
url(string)
Returns
bool
Source:
src/nim2d/system.nim:32
getPowerInfo ¶
proc getPowerInfo(): tuple[state: string, percent: int, seconds: int]
Battery state, charge percent and seconds of charge left. The state is one
of "battery", "charging", "charged", "nobattery" or "unknown", and percent and seconds are -1 when they cannot be determined.
Returns
tuple[state: string, percent: int, seconds: int]
Source:
src/nim2d/system.nim:36
Generated with mkdocstrings-nim