Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide console mouse cursor when ui_mouse is 0 #315

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Quake/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif

extern qboolean keydown[256];
extern cvar_t ui_mouse;

int con_linewidth;

Expand Down Expand Up @@ -581,6 +582,10 @@ static void Con_SetMouseState (conmouse_t state)
int x, y;
conofs_t pos;

// When mouse cursor disabled, do not select text on click or open hotlinks.
if (!ui_mouse.value)
return;

if (con_mousestate == state)
return;

Expand Down Expand Up @@ -632,6 +637,10 @@ Mouse movement callback
*/
void Con_Mousemove (int x, int y)
{
// When mouse cursor disabled, do not select text on drag or set hotlinks.
if (!ui_mouse.value)
return;

if (con_mousestate == CMS_NOTPRESSED)
{
Con_SetHotLink (Con_GetLinkAtPixel (x, y));
Expand Down
2 changes: 1 addition & 1 deletion Quake/in_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void IN_Deactivate (qboolean free_cursor)

void IN_DeactivateForConsole (void)
{
IN_Deactivate(true);
IN_Deactivate(modestate == MS_WINDOWED || ui_mouse.value);
}

void IN_DeactivateForMenu (void)
Expand Down