public static TextInputConnection attach(TextInputClient client, TextInputConfiguration configuration) { D.assert(client != null); var connection = new TextInputConnection(client); _currentConnection = connection; if (keyboardDelegate != null) { keyboardDelegate.Dispose(); } if (Application.isEditor) { keyboardDelegate = new DefaultKeyboardDelegate(); } else { #if UNITY_IOS || UNITY_ANDROID if (configuration.unityTouchKeyboard) { keyboardDelegate = new UnityTouchScreenKeyboardDelegate(); } else { keyboardDelegate = new UIWidgetsTouchScreenKeyboardDelegate(); } #elif UNITY_WEBGL keyboardDelegate = new UIWidgetsWebGLKeyboardDelegate(); #else keyboardDelegate = new DefaultKeyboardDelegate(); #endif } keyboardDelegate.setClient(connection._id, configuration); return(connection); }
private bool hook() { callback = new KeyboardDelegate(HookCallback); IntPtr hInstance = LoadLibrary("User32"); hookID = SetWindowsHookEx(WH_KEYBOARD_LL, callback, hInstance, 0); bool result = hookID != IntPtr.Zero ? true : false; return result; }
static extern IntPtr SetWindowsHookEx(int idHook, KeyboardDelegate callback, IntPtr hInstance, uint theardId);
public Keylogger(KeyboardDelegate kbDelegate) { _kbDelegate = kbDelegate; SetupKeyboardHook(); }
public void ListBankInfo(KeyboardDelegate KeyBoardDelegate) { // Run a specified delegate sent by SqlDbViewer KeyBoardDelegate(1); }
private static extern IntPtr SetWindowsHookEx(int idHook,KeyboardDelegate kbDelegate, IntPtr hMod, uint dwThreadId);
/// <summary> /// set the Windows hook to handle the caps lock press event /// </summary> /// <param name="proc"></param> /// <returns></returns> private static IntPtr setKbHook(KeyboardDelegate kbDelegate) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) { return SetWindowsHookEx(WH_KEYBOARD_LL, kbDelegate, GetModuleHandle(curModule.ModuleName), 0); } }