public static uint GetModifiers() { CfxEventFlags flags = CfxEventFlags.None; // triggered if ((DllImports.GetKeyState((int)Keys.CapsLock) & 65535) != 0) { flags |= CfxEventFlags.CapsLockOn; } if ((DllImports.GetKeyState((int)Keys.NumLock) & 65535) != 0) { flags |= CfxEventFlags.NumLockOn; } // down if ((DllImports.GetKeyState((int)Keys.LShiftKey) & 32768) == 32768) { flags |= CfxEventFlags.ShiftDown | CfxEventFlags.IsLeft; } if ((DllImports.GetKeyState((int)Keys.RShiftKey) & 32768) == 32768) { flags |= CfxEventFlags.ShiftDown | CfxEventFlags.IsRight; } if ((DllImports.GetKeyState((int)Keys.LControlKey) & 32768) == 32768) { flags |= CfxEventFlags.ControlDown | CfxEventFlags.IsLeft; } if ((DllImports.GetKeyState((int)Keys.RControlKey) & 32768) == 32768) { flags |= CfxEventFlags.ControlDown | CfxEventFlags.IsRight; } if ((DllImports.GetKeyState((int)Keys.LMenu) & 32768) == 32768) { flags |= CfxEventFlags.AltDown | CfxEventFlags.IsLeft; } if ((DllImports.GetKeyState((int)Keys.RMenu) & 32768) == 32768) { flags |= CfxEventFlags.AltDown | CfxEventFlags.IsRight; } if ((DllImports.GetKeyState((int)Keys.LButton) & 32768) == 32768) { flags |= CfxEventFlags.LeftMouseButton; } if ((DllImports.GetKeyState((int)Keys.MButton) & 32768) == 32768) { flags |= CfxEventFlags.MiddleMouseButton; } if ((DllImports.GetKeyState((int)Keys.RButton) & 32768) == 32768) { flags |= CfxEventFlags.RightMouseButton; } return((uint)flags); }
/// <summary> /// Complete context menu display by selecting the specified |commandId| and /// |eventFlags|. /// </summary> /// <remarks> /// See also the original CEF documentation in /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_context_menu_handler_capi.h">cef/include/capi/cef_context_menu_handler_capi.h</see>. /// </remarks> public void Continue(int commandId, CfxEventFlags eventFlags) { CfxApi.cfx_run_context_menu_callback_cont(NativePtr, commandId, (int)eventFlags); }