Где кнопка Return на клавиатуре?
Ребята, всем привет. Нет слов, кнопка Return? Что еще за кнопка такая на клавиатуре, о которой я даже никогда не слышал! Начал узнавать в интернете. Понял. Но не все так просто.
Кнопка Return — Разбираемся
Стоп. Сразу коротко отвечаю — кнопка return сегодня это тоже самое что и энтер. В 99%.
Значит пишу все как есть — на некоторых клавиатурах раньше или и сейчас может быть кнопка Return, вообще есть две версии:
- Такая кнопка была на старых клавах.
- Сейчас есть такая кнопка на клавиатурах Маков.
И походу вторая версия — скорее всего правдивая. Потому что.. в общем на одном сайте нашел интересную инфу:
Так что кнопка Return это тоже самое что и энтер, который всем нам знаком:
Да, она также бывает и в правом нижнем углу, но этим энтером, как правило люди редко пользуются.
Я решил поискать картинки — да, нашел, вот маковская клава и тут… правда тут enter и return написано на одной клавише:
Вот еще пример — это уже клава ноута:
Вот нашел ноутбук Мак Бук Про какой-то, тут на клаве тоже самое — return и enter написано на одной клавише:
Заключение
Итак ребята, вывод можно сделать такой:
- Кнопка return и enter — имеет в 99% одно и тоже значение, и только в некоторых прогах действие может быть разное. И это еще при условии, что на клаве есть две кнопки — одна return, другая enter. Если присутствует только одна кнопка return — значит действие ее аналогично энтеру.
- Кнопка есть на Мак-клавах. Да, возможно на каких-то древних клавах под винду тоже была кнопка return, но.. думаю что действие ее сейчас аналогично энтеру.
- Две разные кнопки — enter и return может были именно на старых клавах Маков? Я имею ввиду по отдельности. А сейчас убрали.. например для экономии места, все таки ноут. А на клавах под виндовс может и не было никогда кнопки return. Ну ребята, это скорее.. мои мысли, но тем не менее..
Надеюсь информация была полезной. Удачи и добра, до новых встреч господа!
WM_XBUTTONDOWN message
Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has captured the mouse.
A window receives this message through its WindowProc function.
Parameters
The low-order word indicates whether various virtual keys are down. It can be one or more of the following values.
Value | Meaning |
---|---|
MK_CONTROL 0x0008 | The CTRL key is down. |
MK_LBUTTON 0x0001 | The left mouse button is down. |
MK_MBUTTON 0x0010 | The middle mouse button is down. |
MK_RBUTTON 0x0002 | The right mouse button is down. |
MK_SHIFT 0x0004 | The SHIFT key is down. |
MK_XBUTTON1 0x0020 | The first X button is down. |
MK_XBUTTON2 0x0040 | The second X button is down. |
The high-order word indicates which button was clicked. It can be one of the following values.
Value | Meaning |
---|---|
XBUTTON1 0x0001 | The first X button was clicked. |
XBUTTON2 0x0002 | The second X button was clicked. |
The low-order word specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
The high-order word specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the client area.
Return value
If an application processes this message, it should return TRUE. For more information about processing the return value, see the Remarks section.
Remarks
Use the following code to get the information in the wParam parameter:
Use the following code to obtain the horizontal and vertical position:
As noted above, the x-coordinate is in the low-order short of the return value; the y-coordinate is in the high-order short (both represent signed values because they can take negative values on systems with multiple monitors). If the return value is assigned to a variable, you can use the MAKEPOINTS macro to obtain a POINTS structure from the return value. You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- or y-coordinate.
Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitors can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.
Unlike the WM_LBUTTONDOWN, WM_MBUTTONDOWN, and WM_RBUTTONDOWN messages, an application should return TRUE from this message if it processes it. Doing so allows software that simulates this message on Windows systems earlier than Windows 2000 to determine whether the window procedure processed the message or called DefWindowProc to process it.
Button Messages
A button can send messages to its parent window, and a parent window can send messages to a button.
The following topics are discussed in this section.
Sending Messages to Buttons
A parent window can send messages to a button in an overlapped or child window by using the SendMessage function, or it can send messages to a button in a dialog box by using the SendDlgItemMessage, CheckDlgButton, CheckRadioButton, and IsDlgButtonChecked functions.
An application can use the BM_GETCHECK message to retrieve the check state of a check box or radio button. An application can also use the BM_GETSTATE message to retrieve the button’s current states (the check state, push state, and focus state). To get information about a specific state, use a bitmask on the returned state value.
The BM_SETCHECK message sets the check state of a check box or radio button; the message returns zero. The BM_SETSTATE message sets the push state of a button; this message also returns zero. The BM_SETSTYLE message changes the style of a button. It is designed for changing button styles within a type (for example, changing a check box to an automatic check box). It is not designed for changing between types (for example, changing a check box to a radio button). An application should not change a button from one type to another.
A button of the BS_BITMAP or BS_ICON style displays a bitmap or icon instead of text. The BM_SETIMAGE message associates a handle to a bitmap or icon with a button. The BM_GETIMAGE message retrieves a handle to the bitmap or icon associated with a button.
An application can also use the DM_GETDEFID message to retrieve the identifier of the default push button control in a dialog box. An application can use the DM_SETDEFID message to set the default push button for a dialog box.
Handling Messages from a Button
Notifications from a button are sent as either WM_COMMAND or WM_NOTIFY messages. Information about which message is used can be found on the reference page for each notification.
For more information on how to handle messages, see Control Messages. See also Button Messages.
Notification Messages from Buttons
When the user clicks a button, its state changes, and the button sends notification codes, in the form of WM_COMMAND messages, to its parent window. For example, a push button control sends the BN_CLICKED notification code whenever the user chooses the button. In all cases (except for BCN_HOTITEMCHANGE), the low-order word of the wParam parameter contains the control identifier, the high-order word of wParam contains the notification code, and the lParam parameter contains the control window handle.
Both the message and the parent window’s response depend on the type, style, and current state of the button. Following are the button notification codes an application should monitor and process.
Notification code | Description |
---|---|
BCN_HOTITEMCHANGE | The mouse entered or left the client area of a button. |
BN_CLICKED | The user clicked a button. |
BN_DBLCLK or BN_DOUBLECLICKED | The user double-clicked a button. |
BN_DISABLE | A button is disabled. |
BN_PUSHED or BN_HILITE | The user pushed a button. |
BN_KILLFOCUS | The button lost the keyboard focus. |
BN_PAINT | The button should be painted. |
BN_SETFOCUS | The button gained the keyboard focus. |
BN_UNPUSHED or BN_UNHILITE | The button is no longer pushed. |
A button sends the BN_DISABLE, BN_PUSHED, BN_KILLFOCUS, BN_PAINT, BN_SETFOCUS, and BN_UNPUSHED notification codes only if it has the BS_NOTIFY style. BN_DBLCLK notification codes are sent automatically for BS_USERBUTTON, BS_RADIOBUTTON, and BS_OWNERDRAW buttons. Other button types send BN_DBLCLK only if they have the BS_NOTIFY style. All buttons send the BN_CLICKED notification code regardless of their button styles.
For automatic buttons, the system changes the push state and paints the button. In this case, the application typically processes only the BN_CLICKED and BN_DBLCLK notification codes. For buttons that are not automatic, the application typically responds to the notification code by sending a message to change the state of the button. For information about sending messages to buttons, see Sending Messages to Buttons.
When the user selects an owner-drawn button, the button sends its parent window a WM_DRAWITEM message containing the identifier of the control to be drawn and information about its dimensions and state.
Button Color Messages
The system provides default color values for buttons. An application can retrieve the default values for these colors by calling the GetSysColor function, or set the values by calling the SetSysColors function. The following table shows the default button-color values.
Value | Element colored |
---|---|
COLOR_BTNFACE | Button faces. |
COLOR_BTNHIGHLIGHT | Highlight area (the top and left edges) of a button. |
COLOR_BTNSHADOW | Shadow area (the bottom and right edges) of a button. |
COLOR_BTNTEXT | Regular (nongrayed) text in buttons. |
COLOR_GRAYTEXT | Disabled (gray) text in buttons. This color is set to 0 if the current display driver does not support a solid gray color. |
COLOR_WINDOW | Window backgrounds. |
COLOR_WINDOWFRAME | Window frames. |
COLOR_WINDOWTEXT | Text in windows. |
However, calling SetSysColors affects all applications, so you should not call this function to customize buttons for your application.
The system sends a WM_CTLCOLORBTN message to a button’s parent window before drawing a button. This message contains a handle to the button’s device context and a handle to the child window. The parent window can use these handles to change the button’s text and background colors. However, only owner-drawn buttons respond to the parent window processing the message.
Button Default Message Processing
The window procedure for the predefined button control window class carries out default processing for all messages that the button control procedure does not process. When the button control procedure returns FALSE for any message, the predefined window procedure checks the messages and performs the default actions listed in the following table.
Message | Default action | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
BM_CLICK | Sends the button a WM_LBUTTONDOWN and a WM_LBUTTONUP message, and sends the parent window a BN_CLICKED notification code. | ||||||||||||||||
BM_GETCHECK | Returns the check state of the button. | ||||||||||||||||
BM_GETIMAGE | Returns a handle to the bitmap or icon associated with the button or NULL if the button has no bitmap or icon. | ||||||||||||||||
BM_GETSTATE | Returns the current check state, push state, and focus state of the button. | ||||||||||||||||
BM_SETCHECK | Sets the check state for all styles of radio buttons and check boxes. If the wParam parameter is greater than zero for radio buttons, the button is given the WS_TABSTOP style. | ||||||||||||||||
BM_SETIMAGE | Associates the specified bitmap or icon handle with the button and returns a handle to the previous bitmap or icon. | ||||||||||||||||
BM_SETSTATE | Sets the push state of the button. For owner-drawn buttons, a WM_DRAWITEM message is sent to the parent window if the state of the button has changed. | ||||||||||||||||
BM_SETSTYLE | Sets the button style. If the low-order word of the lParam parameter is TRUE, the button is redrawn. | ||||||||||||||||
WM_CHAR | Checks a check box or automatic check box when the user presses the plus (+) or equal (=) keys. Clears a check box or automatic check box when the user presses the minus (–) key. | ||||||||||||||||
WM_ENABLE | Paints the button. | ||||||||||||||||
WM_ERASEBKGND | Erases the background for owner-drawn buttons. The backgrounds of other buttons are erased as part of the WM_PAINT and WM_ENABLE processing. | ||||||||||||||||
WM_GETDLGCODE | Returns values that indicate the type of input processed by the default button procedure, as shown in the following table.
| ||||||||||||||||
WM_GETFONT | Returns a handle to the current font. | ||||||||||||||||
WM_KEYDOWN | Pushes the button if the user presses the SPACEBAR. | ||||||||||||||||
WM_KEYUP | Releases the mouse capture for all cases except the TAB key. | ||||||||||||||||
WM_KILLFOCUS | Removes the focus rectangle from a button. For push buttons and default push buttons, the focus rectangle is invalidated. If the button has the mouse capture, the capture is released, the button is not clicked, and any push state is removed. | ||||||||||||||||
WM_LBUTTONDBLCLK | Sends a BN_DBLCLK notification code to the parent window for radio buttons and owner-drawn buttons. For other buttons, a double-click is processed as a WM_LBUTTONDOWN message. | ||||||||||||||||
WM_LBUTTONDOWN | Highlights the button if the position of the mouse cursor is within the button’s client rectangle. | ||||||||||||||||
WM_LBUTTONUP | Releases the mouse capture if the button had the mouse capture. | ||||||||||||||||
WM_MOUSEMOVE | Performs the same action as WM_LBUTTONDOWN, if the button has the mouse capture. Otherwise, no action is performed. | ||||||||||||||||
WM_NCCREATE | Turns any BS_OWNERDRAW button into a BS_PUSHBUTTON button. | ||||||||||||||||
WM_NCHITTEST | Returns HTTRANSPARENT, if the button control is a group box. | ||||||||||||||||
WM_PAINT | Draws the button according to its style and current state. | ||||||||||||||||
WM_SETFOCUS | Draws a focus rectangle on the button getting the focus. For radio buttons and automatic radio buttons, the parent window is sent a BN_CLICKED notification code. | ||||||||||||||||
WM_SETFONT | Sets a new font and optionally updates the window. | ||||||||||||||||
WM_SETTEXT | Sets the text of the button. In the case of a group box, the message paints over the preexisting text before repainting the group box with the new text. | ||||||||||||||||
WM_SYSKEYUP | Releases the mouse capture for all cases except the TAB key. |
The predefined window procedure passes all other messages to the DefWindowProc function for default processing.