Keyboard shortcuts (Cntl-a, -c, -v) are controlled by the OS. True or false?
I'm asking because I think they are, don't know for certain.
Pab Sungenis
(9,612 posts)The OS decides what to do with any key combination.
but honestly not the OS but the user interface, but I don't think that most mac or windows users would notice the difference between OS and UI.
Also, just imho, many common shortcuts like cntl -c -v and -x are so widely used that a lot of UI's do them - I use them on unity and kde and lde for example.
ManiacJoe
(10,136 posts)However, the base libraries that come with the OS give a default behavior that in these cases most programmers don't change.
ChromeFoundry
(3,270 posts)The Form of the control with focus can optionally handle windowing message events.
If the control has an event handler, the event is sent from the Parent Form to the Control.
When a CTRL+C sequence is pressed, the Form searches for a matching event handler (eg. KeyDown) for the control that has focus or it performs its own processing.
The TextBox control is a Windows control that has a set of default Event Handlers predefined. CTRL+C, A, and V are all handled by the default implementation. A developer can Override these default handlers and perform different actions or ignore the event completely.
Example:
+ WindowMgr ->
+ Window (MessageQueue) -> (Event:KeyDown) ->
+ Form (optional EventHandler:KeyDown) or ->
+ TextBox (optional EventHandler:KeyDown) or ->
+ (base EventHandler:KeyDown) or ->
+ (ignore)
If you wanted to change the way a CTRL+C sequence is handled, You would attach a handler method to the TextBox's KeyDown Event or the Form if the sequence is not specific to the TextBox control (example: Exit the Application).
This is probably more information than you care to know, but it is import to remember that if you set focus to your clock in the taskbar, then press CTRL+C - nothing happens. The time is not copied to the Clipboard. The event is just ignored because the Clock control does not implement the TextBox control. Where as, an application like Notepad is nothing more than a big TextBox control, plus a Menu control. The TextBox control in Notepad is a tool available from the Window Manager... The Notepad application makes a copy of the tool and places it on it's Form. The application can add, delete or override default events for the controls it creates. CTRL+C has a default event for a TextBox when it is not created as a password TextBox.