Documentation
¶
Index ¶
- func ClearScreen(hStdout Handle) error
- func EnableMode(hStdout Handle, flag ...int) error
- func FillAttribute(hStdout Handle, attribute uint16, length int, writeCoord Coord) (uint16, error)
- func FillCharacter(hStdout Handle, character rune, length int, writeCoord Coord) (uint16, error)
- func GetCP() (uint32, error)
- func GetKey(hStdin Handle) (uint16, error)
- func GetMode(hStdout Handle) (uint32, error)
- func GetOutputCP() (uint32, error)
- func GetScreenBufferInfo(hStdout Handle, lpScreenBufferInfo *ScreenBufferInfo) error
- func IsEnableMode(hStdout Handle, flag int) bool
- func ReadInput(hStdin Handle, lpBuffer unsafe.Pointer, length uint32, ...) error
- func ScrollScreenBuffer(hStdout Handle, lpScrollRectangle, lpClipRectangle *SmallRect, ...) error
- func SetCP(wCodePage uint32) error
- func SetCursorInfo(hStdout Handle, lpCursorInfo *CursorInfo) error
- func SetCursorPosition(hStdout Handle, pos Coord) error
- func SetCursorVisible(hStdout Handle, bVisible bool) error
- func SetMode(hStdout Handle, dwMode uint32) error
- func SetOutputCP(wCodePage uint32) error
- func SetTitle(title string) error
- func WriteAttribute(hStdout Handle, attribute uint16, length uint32, writeCoord Coord) (uint16, error)
- func WriteCharacter(hStdout Handle, character uint16, length uint32, writeCoord Coord) (uint16, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearScreen ¶
func ClearScreen(hStdout Handle) error
ClearScreen clears the console screen buffer by filling it with spaces and setting a specified text attribute.
Parameters:
hStdout: The handle to the console screen buffer.
Returns:
error If the function succeeds, the value is nil
func EnableMode ¶
EnableMode enables one or more console screen buffer modes for the specified console screen buffer.
Parameters:
hStdout (Handle): The handle to the console screen buffer. This handle must have GENERIC_READ access rights. flag ([]int): Zero or more console screen buffer modes to enable.
Returns:
error: If the function succeeds, the value is nil
func FillAttribute ¶
FillAttribute writes characters with a specified attribute to the console screen buffer a specified number of times, starting from the specified coordinates.
Parameters:
hStdout: The handle to the console screen buffer. attribute: The attribute to use when writing to the console screen buffer. length: The number of character cells to write. writeCoord: The character coordinates of the first cell where characters will be written.
Returns:
uint16: The actual number of attributes written to the console screen buffer. error: If the function succeeds, the value is nil
func FillCharacter ¶
FillCharacter writes a character to the console screen buffer a specified number of times, starting from the specified coordinates.
Parameters:
hStdout: The handle to the console screen buffer. character: The character to be written to the console screen buffer. length: The number of character cells to write the character to. writeCoord: The character coordinates of the first cell where the character will be written.
Returns:
uint16: The actual number of character written to the console screen buffer. error: If the function succeeds, the value is nil
func GetCP ¶
GetCP retrieves the input code page used by the console associated with the calling process. The console uses its input code page to convert keyboard input into the corresponding character values.
Returns:
uint32: The return value is an uint representing the code page identifier. error: If the function succeeds, the value is nil
func GetKey ¶
GetKey reads and returns a key press event from the console input buffer.
Parameters:
hStdin: The handle to the console input buffer.
Returns:
uint16: The Unicode character code of the key pressed. error: If the function succeeds, the value is nil
func GetMode ¶
GetMode retrieves the current input mode for the console input buffer or the current output mode for the console screen buffer associated with the specified handle.
Parameters:
hStdout: The handle to the console input buffer or console screen buffer. This handle must have GENERIC_READ access rights.
Returns:
uint32: The current mode of the buffer error: If the function succeeds, the value is nil
func GetOutputCP ¶
GetOutputCP retrieves the output code page used by the console associated with the calling process.
Returns:
wCodePage: If the function succeeds, it returns the code page identifier and nil error. err: If the function succeeds, the value is nil
func GetScreenBufferInfo ¶
func GetScreenBufferInfo(hStdout Handle, lpScreenBufferInfo *ScreenBufferInfo) error
GetScreenBufferInfo retrieves information about the specified console screen buffer.
Parameters:
hStdout: The handle to the console screen buffer. lpScreenBufferInfo: A pointer to the ScreenBufferInfo structure that receives information about the console screen buffer.
Returns:
error: If the function succeeds, the value is nil
func IsEnableMode ¶
IsEnableMode retrieves the state of a specific console mode flag.
Parameters:
hStdout: The handle to the console screen buffer. flag: The mode flag to be checked.
Returns:
bool: If the function succeeds, the value is true
func ReadInput ¶
func ReadInput(hStdin Handle, lpBuffer unsafe.Pointer, length uint32, lpNumberOfEventsRead *uint32) error
ReadInput reads console input records from the specified console input buffer.
Parameters:
hStdin: The handle to the console input buffer. lpBuffer: A pointer to an array of INPUT_RECORD structures that receive the input buffer data. length: The size of the array pointed to by lpBuffer. lpNumberOfEventsRead: A pointer to a variable that receives the number of input records read.
Returns:
error: If the function succeeds, the value is nil
func ScrollScreenBuffer ¶
func ScrollScreenBuffer(hStdout Handle, lpScrollRectangle, lpClipRectangle *SmallRect, destinationOrigin Coord, lpFill CharInfo) error
ScrollScreenBuffer scrolls the contents of the console screen buffer.
Parameters:
hStdout: The handle to the console output buffer. lpScrollRectangle: A pointer to the SMALL_RECT structure that specifies the top-left and bottom-right coordinates of the console screen buffer rectangle to be moved. lpClipRectangle: A pointer to the SMALL_RECT structure that specifies the top-left and bottom-right coordinates of the console screen buffer rectangle affected by the scroll. This pointer can be NULL. destinationOrigin: Specifies the new location of the top-left corner of the contents of lpScrollRectangle (in characters). lpFill: Specifies the character and color attributes to be used for filling any areas left empty in the intersection of lpScrollRectangle and lpClipRectangle due to the move.
Returns:
error: If the function succeeds, the value is nil
func SetCP ¶
SetCP sets the input code page used by the console associated with the calling process. The console uses its input code page to convert keyboard input into the corresponding character values.
Parameters:
wCodePageID: The identifier of the code page to set.
Returns:
error: If the function succeeds, the value is nil
func SetCursorInfo ¶
func SetCursorInfo(hStdout Handle, lpCursorInfo *CursorInfo) error
SetCursorInfo updates the cursor size and visibility information for the specified console screen buffer.
Parameters:
hStdout (Handle): The handle to the console screen buffer. This handle must have GENERIC_READ access rights. lpCursorInfo (*CursorInfo): A pointer to a CursorInfo structure that provides new specifications for the cursor of the console screen buffer.
Returns:
error: If the function succeeds, the value is nil
func SetCursorPosition ¶
func SetCursorPosition(hStdout Handle, pos Coord) error
SetCursorPosition sets the cursor position within the specified console screen buffer.
Parameters:
hStdout: The handle to the console screen buffer. This handle must have GENERIC_READ access rights. pos: The new cursor position specified as a COORD structure, measured in character units. Coordinates are in terms of columns and rows of character cells in the screen buffer. The coordinates must be within the boundaries of the console screen buffer.
Returns:
error : If the function succeeds, the value is nil
func SetCursorVisible ¶
SetCursorVisible sets the visibility of the console cursor.
Parameters:
hStdout: The handle to the console screen buffer. This handle must have GENERIC_READ access rights. bVisible: Indicates whether the cursor should be visible (true) or hidden (false).
Returns:
error If the function succeeds, the value is nil
func SetMode ¶
SetMode sets the input or output mode for the console input buffer or console screen buffer associated with the specified handle.
Parameters:
hStdout: The handle to the console input buffer or console screen buffer. This handle must have GENERIC_READ access rights. dwMode: The mode to be set for input or output.
Returns:
error: If the function succeeds, the value is nil
func SetOutputCP ¶
SetOutputCP SetConsoleOutputCP sets the output code page used by the console associated with the calling process. The console uses its output code page to convert character values written by various output functions into the images displayed in the console window.
Parameters:
wCodePageID: The identifier of the code page to set.
Returns:
error: If the function succeeds, the value is nil
func SetTitle ¶
SetTitle sets the title of the current console window.
Parameters:
title: A string to be displayed in the title bar of the console window. The total size must be less than 64K.
Returns:
error: If the function succeeds, the value is nil
func WriteAttribute ¶
func WriteAttribute(hStdout Handle, attribute uint16, length uint32, writeCoord Coord) (uint16, error)
WriteAttribute writes a specified attribute to the console screen buffer.
Parameters:
hStdout: The handle to the console output buffer. attribute: The attribute to be written to the console screen buffer. length: The number of screen buffer character cells to which the attribute should be copied. writeCoord: The coordinates of the first character cell in the console screen buffer to receive the attribute.
Returns:
uint16: The actual number of attributes written to the console screen buffer. error: If the function succeeds, the value is nil
func WriteCharacter ¶
func WriteCharacter(hStdout Handle, character uint16, length uint32, writeCoord Coord) (uint16, error)
WriteCharacter writes a specified character to the console screen buffer.
Parameters:
hStdout: The handle to the console output buffer. character: The character to be written to the console screen buffer. length: The number of characters to be written. writeCoord: The coordinates of the first character cell in the console screen buffer to receive the character.
Returns:
uint16: The actual number of characters written to the console screen buffer. error: If the function succeeds, the value is nil
Types ¶
This section is empty.