mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-09-28 03:30:53 +00:00
update
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace stonevox
|
||||
{
|
||||
public class ConsoleUtil
|
||||
{
|
||||
[DllImport("kernel32.dll")]
|
||||
static extern bool SetConsoleMode(IntPtr hConsoleHandle, int mode);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
static extern bool GetConsoleMode(IntPtr hConsoleHandle, out int mode);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
static extern IntPtr GetStdHandle(int handle);
|
||||
|
||||
const int STD_INPUT_HANDLE = -10;
|
||||
const int ENABLE_QUICK_EDIT_MODE = 0x40 | 0x80;
|
||||
|
||||
public static void EnableQuickEditMode()
|
||||
{
|
||||
int mode;
|
||||
IntPtr handle = GetStdHandle(STD_INPUT_HANDLE);
|
||||
GetConsoleMode(handle, out mode);
|
||||
mode |= ENABLE_QUICK_EDIT_MODE;
|
||||
SetConsoleMode(handle, mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user