keyboard.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Keyboard Event Processing </title>
  8. <meta name="viewport" content="width=device-width">
  9. <meta name="title" content="Keyboard Event Processing ">
  10. <meta name="generator" content="docfx 2.18.2.0">
  11. <link rel="shortcut icon" href="../favicon.ico">
  12. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  13. <link rel="stylesheet" href="../styles/docfx.css">
  14. <link rel="stylesheet" href="../styles/main.css">
  15. <meta property="docfx:navrel" content="">
  16. <meta property="docfx:tocrel" content="">
  17. </head>
  18. <body data-spy="scroll" data-target="#affix">
  19. <div id="wrapper">
  20. <header>
  21. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  22. <div class="container">
  23. <div class="navbar-header">
  24. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  25. <span class="sr-only">Toggle navigation</span>
  26. <span class="icon-bar"></span>
  27. <span class="icon-bar"></span>
  28. <span class="icon-bar"></span>
  29. </button>
  30. <a class="navbar-brand" href="../index.html">
  31. <img id="logo" class="svg" src="../logo.svg" alt="">
  32. </a>
  33. </div>
  34. <div class="collapse navbar-collapse" id="navbar">
  35. <form class="navbar-form navbar-right" role="search" id="search">
  36. <div class="form-group">
  37. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  38. </div>
  39. </form>
  40. </div>
  41. </div>
  42. </nav>
  43. <div class="subnav navbar navbar-default">
  44. <div class="container hide-when-search" id="breadcrumb">
  45. <ul class="breadcrumb">
  46. <li></li>
  47. </ul>
  48. </div>
  49. </div>
  50. </header>
  51. <div role="main" class="container body-content hide-when-search">
  52. <div class="article row grid">
  53. <div class="col-md-10">
  54. <article class="content wrap" id="_content" data-uid="">
  55. <h1 id="keyboard-event-processing">Keyboard Event Processing</h1>
  56. <p>Keyboard events are sent by the <a href="mainloop.html">Main Loop</a> to the
  57. Application class for processing. The keyboard events are sent
  58. exclusively to the current <code>Toplevel</code>, this being either the default
  59. that is created when you call <code>Application.Init</code>, or one that you
  60. created an passed to <code>Application.Run(Toplevel)</code>. </p>
  61. <h2 id="flow">Flow</h2>
  62. <p>Keystrokes are first processes as hotkeys, then as regular keys, and
  63. there is a final cold post-processing event that is invoked if no view
  64. processed the key.</p>
  65. <h2 id="hotkey-processing">HotKey Processing</h2>
  66. <p>Events are first send to all views as a &quot;HotKey&quot;, this means that the
  67. <code>View.ProcessHotKey</code> method is invoked on the current toplevel, which
  68. in turns propagates this to all the views in the hierarchy. If any
  69. view decides to process the event, no further processing takes place.</p>
  70. <p>This is how hotkeys for buttons are implemented. For example, the
  71. keystroke &quot;Alt-A&quot; is handled by Buttons that have a hot-letter &quot;A&quot; to
  72. activate the button.</p>
  73. <h2 id="regular-processing">Regular Processing</h2>
  74. <p>Unlike the hotkey processing, the regular processing is only sent to
  75. the currently focused view in the focus chain.</p>
  76. <p>The regular key processing is only invoked if no hotkey was caught.</p>
  77. <h2 id="cold-key-processing">Cold-key Processing</h2>
  78. <p>This stage only is executed if the focused view did not process the
  79. event, and is broadcast to all the views in the Toplevel.</p>
  80. <p>This method can be overwritten by views that want to provide
  81. accelerator functionality (Alt-key for example), but without
  82. interefering with normal ProcessKey behavior.</p>
  83. </article>
  84. </div>
  85. <div class="hidden-sm col-md-2" role="complementary">
  86. <div class="sideaffix">
  87. <div class="contribution">
  88. <ul class="nav">
  89. <li>
  90. <a href="https://github.com/migueldeicaza/gui.cs/blob/master/docfx/articles/keyboard.md/#L1" class="contribution-link">Improve this Doc</a>
  91. </li>
  92. </ul>
  93. </div>
  94. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  95. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  96. </nav>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <footer>
  102. <div class="grad-bottom"></div>
  103. <div class="footer">
  104. <div class="container">
  105. <span class="pull-right">
  106. <a href="#top">Back to top</a>
  107. </span>
  108. <span>Copyright © 2015-2017 Microsoft<br>Generated by <strong>DocFX</strong></span>
  109. </div>
  110. </div>
  111. </footer>
  112. </div>
  113. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  114. <script type="text/javascript" src="../styles/docfx.js"></script>
  115. <script type="text/javascript" src="../styles/main.js"></script>
  116. </body>
  117. </html>