mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixes #518. Added mouse support for the NetDriver.
This commit is contained in:
@@ -635,6 +635,7 @@ namespace Terminal.Gui {
|
||||
}
|
||||
keyDownHandler (new KeyEvent (k, MapKeyModifiers (k)));
|
||||
keyHandler (new KeyEvent (k, MapKeyModifiers (k)));
|
||||
keyUpHandler (new KeyEvent (k, MapKeyModifiers (k)));
|
||||
}
|
||||
// Cause OnKeyUp and OnKeyPressed. Note that the special handling for ESC above
|
||||
// will not impact KeyUp.
|
||||
|
||||
@@ -28,9 +28,8 @@
|
||||
using System;
|
||||
|
||||
namespace Unix.Terminal {
|
||||
|
||||
public partial class Curses {
|
||||
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
|
||||
public partial class Curses {
|
||||
public class Window {
|
||||
public readonly IntPtr Handle;
|
||||
static Window curscr;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -158,6 +158,7 @@ namespace Terminal.Gui {
|
||||
|
||||
switch (keyEvent.Key) {
|
||||
case Key.AltMask:
|
||||
case Key.CtrlMask | Key.Space:
|
||||
if (MenuBar != null && MenuBar.OnKeyDown (keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
@@ -176,6 +177,7 @@ namespace Terminal.Gui {
|
||||
|
||||
switch (keyEvent.Key) {
|
||||
case Key.AltMask:
|
||||
case Key.CtrlMask | Key.Space:
|
||||
if (MenuBar != null && MenuBar.OnKeyUp (keyEvent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -808,7 +808,7 @@ namespace Terminal.Gui {
|
||||
///<inheritdoc/>
|
||||
public override bool OnKeyDown (KeyEvent keyEvent)
|
||||
{
|
||||
if (keyEvent.IsAlt) {
|
||||
if (keyEvent.IsAlt || (keyEvent.IsCtrl && keyEvent.Key == (Key.CtrlMask | Key.Space))) {
|
||||
openedByAltKey = true;
|
||||
SetNeedsDisplay ();
|
||||
openedByHotKey = false;
|
||||
@@ -819,9 +819,10 @@ namespace Terminal.Gui {
|
||||
///<inheritdoc/>
|
||||
public override bool OnKeyUp (KeyEvent keyEvent)
|
||||
{
|
||||
if (keyEvent.IsAlt) {
|
||||
if (keyEvent.IsAlt || (keyEvent.IsCtrl && keyEvent.Key == (Key.CtrlMask | Key.Space))) {
|
||||
// User pressed Alt - this may be a precursor to a menu accelerator (e.g. Alt-F)
|
||||
if (!keyEvent.IsCtrl && openedByAltKey && !IsMenuOpen && openMenu == null && ((uint)keyEvent.Key & (uint)Key.CharMask) == 0) {
|
||||
if (openedByAltKey && !IsMenuOpen && openMenu == null && (((uint)keyEvent.Key & (uint)Key.CharMask) == 0
|
||||
|| ((uint)keyEvent.Key & (uint)Key.CharMask) == (uint)Key.Space)) {
|
||||
// There's no open menu, the first menu item should be highlight.
|
||||
// The right way to do this is to SetFocus(MenuBar), but for some reason
|
||||
// that faults.
|
||||
|
||||
Reference in New Issue
Block a user