⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sec-keyandmousebindings.html

📁 gtk 开发手册和参考文档。 包括gtk glib gdk等
💻 HTML
字号:
<HTML><HEAD><TITLE>Key and Mouse bindings</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.49"><LINKREL="HOME"TITLE="GTK+ 1.2 Tutorial"HREF="gtk-tut.html"><LINKREL="UP"TITLE="Range Widgets"HREF="ch-rangewidgets.html"><LINKREL="PREVIOUS"TITLE="Common Range Functions"HREF="sec-commonrangefunctions.html"><LINKREL="NEXT"TITLE="Example"HREF="sec-rangewidgetsexample.html"></HEAD></head><body bgcolor="#FFFFFF" marginheight=0 marginwidth=0 width="100%"><table cellspacing=6 border=0 cellpadding=0 width="100%">  <tr>    <td bgcolor="#FFFFFF" valign=top nowrap>    <centeR><A HREF="/"><img src="/images/gtk-logo-rgb.gif" width=107 height=140 border=0></A>      <font face="helvetica,lucidia" color="#000000"><BR><BR><b>GTK+<BR>The GIMP Toolkit</b></center><BR><table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>General</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/">Introduction</A><BR><A HREF="/screenshots/">Screenshots</A><br><A HREF="/download/">Download</A><br><A HREF="/mailinglists.html">Mailing Lists</A><BR><A HREF="/bindings.html">Language Bindings</A><BR><A HREF="http://gtk.themes.org/">Themes</A><BR><A HREF="/bugs.html">Bug Tracker</A><BR></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Documentation</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="/faq/">FAQ</A><br><A HREF="/tutorial/">Tutorial</A><BR><A HREF="/api/">API Reference</A><br><A HREF="/books.html">Published Books</A><BR></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B>Projects</B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.pango.org/">Pango</A><BR><A HREF="http://sources.redhat.com/inti/">Inti</A><BR><A HREF="http://www.gnome.org/">GNOME</A><BR><A HREF="http://user.sgic.fi/~tml/gimp/win32/">GTK+ for Win32</A><br><A HREF="http://people.redhat.com/sopwith/gtkfb/">GtkFB (Framebuffer)</A><br><A HREF="http://www.directfb.org/gtk.xml">GTK+ on DirectFB</A><BR><A HREF="/beos/">GTK+ for BeOS</A></td></tr></table></td></tr></table><BR>  <table width=100% cellspacing=0 cellpadding=2 border=0><tr><td bgcolor="#000000"><table width=100% cellspacing=0 cellpadding=4 border=0><tr><td bgcolor="#AAAAEE" nowrap><B><B>Applications</B></B></td></tr><tr><td bgcolor="#FFFFFF" nowrap><A HREF="http://www.gimp.org/">GIMP</A><BR><A HREF="http://www.abiword.org/">Abiword</A><BR><A HREF="http://www.lysator.liu.se/~alla/dia/dia.html">Dia</A><BR><A HREF="http://glade.pn.org/">Glade</A><BR><A HREF="http://www.gnucash.org/">GnuCash</A><BR><A HREF="http://www.gnome.org/projects/gnumeric/">Gnumeric</A><BR><BR><A HREF="http://www.gnome.org/applist/">GNOME Software Map</A><br></td></tr></table></td></tr></table><BR>      </td>  <td bgcolor="#ffffff" valign=top width="99%"><font face="lucida,helvetica"><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">GTK+ 1.2 Tutorial</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sec-commonrangefunctions.html">&#60;&#60;&#60; Previous</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 8. Range Widgets</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sec-rangewidgetsexample.html">Next &#62;&#62;&#62;</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="SEC-KEYANDMOUSEBINDINGS">8.4. Key and Mouse bindings</A></H1><P>All of the GTK range widgets react to mouse clicks in more or lessthe same way. Clicking button-1 in the trough will cause itsadjustment's <TTCLASS="LITERAL">page_increment</TT> to be added or subtracted from its<TTCLASS="LITERAL">value</TT>, and the slider to be moved accordingly. Clicking mousebutton-2 in the trough will jump the slider to the point at which thebutton was clicked. Clicking any button on a scrollbar's arrows willcause its adjustment's value to change <TTCLASS="LITERAL">step_increment</TT> at a time.</P><P>It may take a little while to get used to, but by default, scrollbarsas well as scale widgets can take the keyboard focus in GTK. If youthink your users will find this too confusing, you can always disablethis by unsetting the <TTCLASS="LITERAL">GTK_CAN_FOCUS</TT> flag on the scrollbar, likethis:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GTK_WIDGET_UNSET_FLAGS (scrollbar, GTK_CAN_FOCUS);</PRE></TD></TR></TABLE><P>The key bindings (which are, of course, only active when the widgethas focus) are slightly different between horizontal and verticalrange widgets, for obvious reasons. They are also not quite the samefor scale widgets as they are for scrollbars, for somewhat lessobvious reasons (possibly to avoid confusion between the keys forhorizontal and vertical scrollbars in scrolled windows, where bothoperate on the same area).</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN675">8.4.1. Vertical Range Widgets</A></H2><P>All vertical range widgets can be operated with the up and down arrowkeys, as well as with the <TTCLASS="LITERAL">Page Up</TT> and <TTCLASS="LITERAL">Page Down</TT> keys. Thearrows move the slider up and down by <TTCLASS="LITERAL">step_increment</TT>, while<TTCLASS="LITERAL">Page Up</TT> and <TTCLASS="LITERAL">Page Down</TT> move it by <TTCLASS="LITERAL">page_increment</TT>.</P><P>The user can also move the slider all the way to one end or the otherof the trough using the keyboard. With the VScale widget, this isdone with the <TTCLASS="LITERAL">Home</TT> and <TTCLASS="LITERAL">End</TT> keys, whereas with theVScrollbar widget, this is done by typing <TTCLASS="LITERAL">Control-Page Up</TT>and <TTCLASS="LITERAL">Control-Page Down</TT>.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN689">8.4.2. Horizontal Range Widgets</A></H2><P>The left and right arrow keys work as you might expect in thesewidgets, moving the slider back and forth by <TTCLASS="LITERAL">step_increment</TT>. The<TTCLASS="LITERAL">Home</TT> and <TTCLASS="LITERAL">End</TT> keys move the slider to the ends of the trough.For the HScale widget, moving the slider by <TTCLASS="LITERAL">page_increment</TT> isaccomplished with <TTCLASS="LITERAL">Control-Left</TT> and <TTCLASS="LITERAL">Control-Right</TT>,while for HScrollbar, it's done with <TTCLASS="LITERAL">Control-Home</TT> and<TTCLASS="LITERAL">Control-End</TT>.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sec-commonrangefunctions.html">&#60;&#60;&#60; Previous</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="gtk-tut.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sec-rangewidgetsexample.html">Next &#62;&#62;&#62;</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Common Range Functions</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ch-rangewidgets.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Example</TD></TR></TABLE></DIV>        </td>    </tr></table>  </td>  </tr></table></body></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -