mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-27 00:07:58 +01:00
139 lines
5.6 KiB
HTML
139 lines
5.6 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>Keyboard Event Processing </title>
|
|
<meta name="viewport" content="width=device-width">
|
|
<meta name="title" content="Keyboard Event Processing ">
|
|
<meta name="generator" content="docfx 2.58.5.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="article row grid">
|
|
<div class="col-md-10">
|
|
<article class="content wrap" id="_content" data-uid="">
|
|
<h1 id="keyboard-event-processing">Keyboard Event Processing</h1>
|
|
|
|
<p>Keyboard events are sent by the <a href="mainloop.html">Main Loop</a> to the
|
|
Application class for processing. The keyboard events are sent
|
|
exclusively to the current <code>Toplevel</code>, this being either the default
|
|
that is created when you call <code>Application.Init</code>, or one that you
|
|
created an passed to <code>Application.Run(Toplevel)</code>. </p>
|
|
<h2 id="flow">Flow</h2>
|
|
<p>Keystrokes are first processes as hotkeys, then as regular keys, and
|
|
there is a final cold post-processing event that is invoked if no view
|
|
processed the key.</p>
|
|
<h2 id="hotkey-processing">HotKey Processing</h2>
|
|
<p>Events are first send to all views as a "HotKey", this means that the
|
|
<code>View.ProcessHotKey</code> method is invoked on the current toplevel, which
|
|
in turns propagates this to all the views in the hierarchy. If any
|
|
view decides to process the event, no further processing takes place.</p>
|
|
<p>This is how hotkeys for buttons are implemented. For example, the
|
|
keystroke "Alt-A" is handled by Buttons that have a hot-letter "A" to
|
|
activate the button.</p>
|
|
<h2 id="regular-processing">Regular Processing</h2>
|
|
<p>Unlike the hotkey processing, the regular processing is only sent to
|
|
the currently focused view in the focus chain.</p>
|
|
<p>The regular key processing is only invoked if no hotkey was caught.</p>
|
|
<h2 id="cold-key-processing">Cold-key Processing</h2>
|
|
<p>This stage only is executed if the focused view did not process the
|
|
event, and is broadcast to all the views in the Toplevel.</p>
|
|
<p>This method can be overwritten by views that want to provide
|
|
accelerator functionality (Alt-key for example), but without
|
|
interefering with normal ProcessKey behavior.</p>
|
|
</article>
|
|
</div>
|
|
|
|
<div class="hidden-sm col-md-2" role="complementary">
|
|
<div class="sideaffix">
|
|
<div class="contribution">
|
|
<ul class="nav">
|
|
</ul>
|
|
</div>
|
|
<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>
|