LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2012, 09:03 PM   #1
errigour
Member
 
Registered: May 2009
Posts: 366

Rep: Reputation: 6
ncurses program but no mouse pointer.


Is there anyway to make linux display a mouse pointer in tty2?


Code:
#include <curses.h>

int main () {
  int input;
  MEVENT mouseinput;

  initscr();
  raw (); nodelay(stdscr,1); noecho(); curs_set(0); nonl(); keypad(stdscr,1);
  mousemask (ALL_MOUSE_EVENTS, NULL);

  mvprintw (0,30, "Press q to quit");
  refresh();

  do { // A nasty 100% resource hogging loop, I know. Sorry about that.
    input = wgetch(stdscr);

    if (input == KEY_MOUSE) {
      getmouse (&mouseinput);
      mvprintw (11, 30, "  x = %d  y = %d   ", mouseinput.x, mouseinput.y);
      mvaddch (mouseinput.y, mouseinput.x, 'X');
      refresh ();
    }

  } while (input != 'q');

  endwin ();
}
 
Old 07-01-2012, 09:08 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

in the past I used to install gpm [1] to use the pointer on the console.

HTH,

Evo2.

1. http://unix.schottelius.org/gpm/

---------- Post added 2012-07-02 at 11:08 ----------

Hi,

in the past I used to install gpm [1] to use the pointer on the console.

HTH,

Evo2.

1. http://unix.schottelius.org/gpm/
 
Old 07-02-2012, 02:29 AM   #3
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
whats gpm?
 
Old 07-02-2012, 02:33 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by errigour View Post
whats gpm?
ok, looks like that link I provided was out of date. However, I'm sure you can use your package manager or your favourite search engine to answer the question.

Additionally, since your question was:
Quote:
Is there anyway to make linux display a mouse pointer in tty2?
it should be a pretty safe bet to assume that it is a program that will let you use the mouse on tty2.

Evo2.
 
Old 07-02-2012, 02:38 AM   #5
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
man i've been looking and found nothing.
 
Old 07-02-2012, 02:40 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
How about:

http://www.nico.schottelius.org/software/gpm/

Evo2.
 
Old 07-02-2012, 02:44 AM   #7
errigour
Member
 
Registered: May 2009
Posts: 366

Original Poster
Rep: Reputation: 6
ok thankyou
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mouse pointer starts trembling without provocation n stops only when mouse is shaken! Aquarius_Girl Linux - Newbie 15 12-03-2010 03:51 AM
Looking For a Program That Rotates Mouse Pointer andrei_t Linux - Software 2 01-12-2010 09:39 PM
disconnect USB mouse data from the mouse pointer Yeronimo Programming 0 04-07-2005 03:26 AM
Erratic mouse pointer with wireless USB mouse jomax Fedora 0 01-04-2005 03:38 AM
The you have a Mouse Pointer Problem(mouse stick top left)here is the solution. dr4ven Linux - Hardware 0 05-25-2003 05:53 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration