ConsoleMouseInput it's a library that contains WinApi Module
and Console Mouse
provider.
Provides you with mouse positions
:
- Global position.
- Relative to the console window.
- Clamped position relative to the console window.
- Console cursor position (cursor in char buffer).
Provides you with window api
:
- Window handle.
- Global cursor position.
- Window rect.
- Client window rect (console content rect).
Provides you with console api
:
- Console window handle.
- Console window information ( offsets, win size, content size ).
- Font used by the console.
Console paint
using DiNet.Common;
using DiNet.ConsoleMouseInput;
Loop();
while(true)
{ }
static async void Loop()
{
await Task.Run(() => {
Vector2<int> pos = new();
while (true)
{
if (!ConsoleWindow.IsMouseInWindowBounds()) // Checking if mouse in console bounds
continue;
var newPos = ConsoleWindow.GetConsoleCursorPosition(); // Taking console cursor position
Console.SetCursorPosition(newPos.x, newPos.y); // Setting cursor to the point
if (newPos != pos)
{
pos = newPos;
Console.Write('#'); // Drawing the char symbol
}
}
});
}
Only fantasy limits you.