MSVC 2010: Allow right-click menu in console during input
When I call cin
or getline
with cin in my Visual Studio 2010 C++ app, I can enter something in the console (as it should be), but the right-click context me开发者_如何学Gonu is "blocked". It doesn't appear - this means I and my clients are not able to use copy and paste.
- How to enable the context menu in the console with cin?
This is an end user configuration for console windows. Click on the title bar icon, select properties, on the options tab, uncheck QuickEdit mode.
However copy & past is in fact simpler in QuickEdit mode: Right click performs an immediate paste operation if there is text in the clipboard. Text is copied by highlighting by dragging over the text to be copied, and pressing "Enter" to place the text in the clipboard. Switching off QuickEdit us useful for console programs that consume mouse events directly.
I am not sure that there is a programmatic method of switching the edit mode, but since it is by design an end user preference, it would probably be bad form to impose your own preference.
精彩评论