Files
Terminal.Gui/docs/api/Terminal.Gui/Terminal.Gui.ShortcutHelper.html

603 lines
22 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class ShortcutHelper
</title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class ShortcutHelper
">
<meta name="generator" content="docfx 2.59.0.0">
<link rel="shortcut icon" href="../../favicon.ico">
<link rel="stylesheet" href="../../styles/docfx.vendor.css">
<link rel="stylesheet" href="../../styles/docfx.css">
<link rel="stylesheet" href="../../styles/main.css">
<meta property="docfx:navrel" content="../../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../images/logo48.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Terminal.Gui.ShortcutHelper">
<h1 id="Terminal_Gui_ShortcutHelper" data-uid="Terminal.Gui.ShortcutHelper" class="text-break">Class ShortcutHelper
</h1>
<div class="markdown level0 summary">
Represents a helper to manipulate shortcut keys used on views.
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">ShortcutHelper</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="Terminal.Gui.html">Terminal.Gui</a></h6>
<h6><strong>Assembly</strong>: Terminal.Gui.dll</h6>
<h5 id="Terminal_Gui_ShortcutHelper_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class ShortcutHelper</code></pre>
</div>
<h3 id="properties">Properties
</h3>
<a id="Terminal_Gui_ShortcutHelper_Shortcut_" data-uid="Terminal.Gui.ShortcutHelper.Shortcut*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_Shortcut" data-uid="Terminal.Gui.ShortcutHelper.Shortcut">Shortcut</h4>
<div class="markdown level1 summary">
This is the global setting that can be used as a global shortcut to invoke the action on the view.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual Key Shortcut { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_ShortcutAction_" data-uid="Terminal.Gui.ShortcutHelper.ShortcutAction*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_ShortcutAction" data-uid="Terminal.Gui.ShortcutHelper.ShortcutAction">ShortcutAction</h4>
<div class="markdown level1 summary">
The action to run if the <a class="xref" href="Terminal.Gui.ShortcutHelper.html#Terminal_Gui_ShortcutHelper_Shortcut">Shortcut</a> is defined.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual Action ShortcutAction { get; set; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Action</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_ShortcutTag_" data-uid="Terminal.Gui.ShortcutHelper.ShortcutTag*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_ShortcutTag" data-uid="Terminal.Gui.ShortcutHelper.ShortcutTag">ShortcutTag</h4>
<div class="markdown level1 summary">
The keystroke combination used in the <a class="xref" href="Terminal.Gui.ShortcutHelper.html#Terminal_Gui_ShortcutHelper_Shortcut">Shortcut</a> as string.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual ustring ShortcutTag { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td></td>
</tr>
</tbody>
</table>
<h3 id="methods">Methods
</h3>
<a id="Terminal_Gui_ShortcutHelper_CheckKeysFlagRange_" data-uid="Terminal.Gui.ShortcutHelper.CheckKeysFlagRange*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_CheckKeysFlagRange_Terminal_Gui_Key_Terminal_Gui_Key_Terminal_Gui_Key_" data-uid="Terminal.Gui.ShortcutHelper.CheckKeysFlagRange(Terminal.Gui.Key,Terminal.Gui.Key,Terminal.Gui.Key)">CheckKeysFlagRange(Key, Key, Key)</h4>
<div class="markdown level1 summary">
Lookup for a <a class="xref" href="Terminal.Gui.Key.html">Key</a> on range of keys.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool CheckKeysFlagRange(Key key, Key first, Key last)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">key</span></td>
<td>The source key.</td>
</tr>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">first</span></td>
<td>First key in range.</td>
</tr>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">last</span></td>
<td>Last key in range.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_FindAndOpenByShortcut_" data-uid="Terminal.Gui.ShortcutHelper.FindAndOpenByShortcut*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_FindAndOpenByShortcut_Terminal_Gui_KeyEvent_Terminal_Gui_View_" data-uid="Terminal.Gui.ShortcutHelper.FindAndOpenByShortcut(Terminal.Gui.KeyEvent,Terminal.Gui.View)">FindAndOpenByShortcut(KeyEvent, View)</h4>
<div class="markdown level1 summary">
Allows a view to run a <a class="xref" href="Terminal.Gui.View.html#Terminal_Gui_View_ShortcutAction">ShortcutAction</a> if defined.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool FindAndOpenByShortcut(KeyEvent kb, View view = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.KeyEvent.html">KeyEvent</a></td>
<td><span class="parametername">kb</span></td>
<td>The <a class="xref" href="Terminal.Gui.KeyEvent.html">KeyEvent</a></td>
</tr>
<tr>
<td><a class="xref" href="Terminal.Gui.View.html">View</a></td>
<td><span class="parametername">view</span></td>
<td>The <a class="xref" href="Terminal.Gui.View.html">View</a></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><code>true</code> if defined <code>false</code>otherwise.</td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_GetKeyToString_" data-uid="Terminal.Gui.ShortcutHelper.GetKeyToString*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_GetKeyToString_Terminal_Gui_Key_Terminal_Gui_Key__" data-uid="Terminal.Gui.ShortcutHelper.GetKeyToString(Terminal.Gui.Key,Terminal.Gui.Key@)">GetKeyToString(Key, out Key)</h4>
<div class="markdown level1 summary">
Return key as string.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static ustring GetKeyToString(Key key, out Key knm)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">key</span></td>
<td>The key to extract.</td>
</tr>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">knm</span></td>
<td>Correspond to the non modifier key.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_GetModifiersKey_" data-uid="Terminal.Gui.ShortcutHelper.GetModifiersKey*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_GetModifiersKey_Terminal_Gui_KeyEvent_" data-uid="Terminal.Gui.ShortcutHelper.GetModifiersKey(Terminal.Gui.KeyEvent)">GetModifiersKey(KeyEvent)</h4>
<div class="markdown level1 summary">
Gets the key with all the keys modifiers, especially the shift key that sometimes have to be injected later.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Key GetModifiersKey(KeyEvent kb)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.KeyEvent.html">KeyEvent</a></td>
<td><span class="parametername">kb</span></td>
<td>The <a class="xref" href="Terminal.Gui.KeyEvent.html">KeyEvent</a> to check.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td>The <a class="xref" href="Terminal.Gui.KeyEvent.html#Terminal_Gui_KeyEvent_Key">Key</a> with all the keys modifiers.</td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_GetShortcutFromTag_" data-uid="Terminal.Gui.ShortcutHelper.GetShortcutFromTag*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_GetShortcutFromTag_NStack_ustring_NStack_ustring_" data-uid="Terminal.Gui.ShortcutHelper.GetShortcutFromTag(NStack.ustring,NStack.ustring)">GetShortcutFromTag(ustring, ustring)</h4>
<div class="markdown level1 summary">
Allows to retrieve a <a class="xref" href="Terminal.Gui.Key.html">Key</a> from a <a class="xref" href="Terminal.Gui.ShortcutHelper.html#Terminal_Gui_ShortcutHelper_ShortcutTag">ShortcutTag</a>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static Key GetShortcutFromTag(ustring tag, ustring delimiter = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td><span class="parametername">tag</span></td>
<td>The key as string.</td>
</tr>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td><span class="parametername">delimiter</span></td>
<td>The delimiter string.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_GetShortcutTag_" data-uid="Terminal.Gui.ShortcutHelper.GetShortcutTag*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_GetShortcutTag_Terminal_Gui_Key_NStack_ustring_" data-uid="Terminal.Gui.ShortcutHelper.GetShortcutTag(Terminal.Gui.Key,NStack.ustring)">GetShortcutTag(Key, ustring)</h4>
<div class="markdown level1 summary">
Get the <a class="xref" href="Terminal.Gui.ShortcutHelper.html#Terminal_Gui_ShortcutHelper_Shortcut">Shortcut</a> key as string.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static ustring GetShortcutTag(Key shortcut, ustring delimiter = null)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">shortcut</span></td>
<td>The shortcut key.</td>
</tr>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td><span class="parametername">delimiter</span></td>
<td>The delimiter string.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">NStack.ustring</span></td>
<td></td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_PostShortcutValidation_" data-uid="Terminal.Gui.ShortcutHelper.PostShortcutValidation*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_PostShortcutValidation_Terminal_Gui_Key_" data-uid="Terminal.Gui.ShortcutHelper.PostShortcutValidation(Terminal.Gui.Key)">PostShortcutValidation(Key)</h4>
<div class="markdown level1 summary">
Used at key up validation.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool PostShortcutValidation(Key key)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">key</span></td>
<td>The key to validate.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><code>true</code> if is valid.<code>false</code>otherwise.</td>
</tr>
</tbody>
</table>
<a id="Terminal_Gui_ShortcutHelper_PreShortcutValidation_" data-uid="Terminal.Gui.ShortcutHelper.PreShortcutValidation*"></a>
<h4 id="Terminal_Gui_ShortcutHelper_PreShortcutValidation_Terminal_Gui_Key_" data-uid="Terminal.Gui.ShortcutHelper.PreShortcutValidation(Terminal.Gui.Key)">PreShortcutValidation(Key)</h4>
<div class="markdown level1 summary">
Used at key down or key press validation.
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool PreShortcutValidation(Key key)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Terminal.Gui.Key.html">Key</a></td>
<td><span class="parametername">key</span></td>
<td>The key to validate.</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><code>true</code> if is valid.<code>false</code>otherwise.</td>
</tr>
</tbody>
</table>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<h5>In This Article</h5>
<div></div>
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../../styles/docfx.js"></script>
<script type="text/javascript" src="../../styles/main.js"></script>
</body>
</html>