Thread: cursor

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    4

    cursor

    Can anyone help me on how can I use a cursor in linux programming in C, what I want to do is move the cursor with the keyboard arrows and as I move the cursor to different options everytime I move the cursor the textcolor of the option will be highlighted and when the cursor changes the prevous option color will loose contrast.

  2. #2
    Something Clever ginoitalo's Avatar
    Join Date
    Dec 2001
    Posts
    187
    Start with
    #include <curses.h>

    then use functions like :
    initscr();
    noecho();
    cbreak();
    keypad(stdscr,1);
    to get "control" of the console

    then getch(); to get the keystroke from the user, check to see if it corresponds to the "Left-Key's" numeric value then do whatever you like with it.

    p.s.
    u might have to compile with -lcurses
    p.s.s.
    this should have been posted in the Linux section

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get visible mouse cursor height
    By eXistenZ in forum Windows Programming
    Replies: 10
    Last Post: 09-05-2008, 09:46 PM
  2. Questions about cursor functionality
    By kantze in forum Windows Programming
    Replies: 4
    Last Post: 08-22-2008, 06:42 AM
  3. Custom Animated Cursor
    By willc0de4food in forum Windows Programming
    Replies: 3
    Last Post: 05-13-2005, 10:05 PM
  4. cursor question
    By GodLike in forum Windows Programming
    Replies: 3
    Last Post: 05-09-2002, 06:14 PM
  5. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 08:52 PM