I want to make a simple curosr program using C please help
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do you mean an X11 program? What is your definition of a “simpler cursor” program? If you want to interface with X11 directly, use libX11. If you want to use an intermediate toolkit such as GTK, Qt, etc., you may do that as well. If you want a fancy console-based program, try libcurses.
Which cursor? Text or pointer? For controlling the mouse cursor, osor seems to have the right idea. For controlling text cursor, you can either use the appropriate escape codes for the terminal type your program runs under, or use the curses/ncurses library to do the work in a more standardized way.
--- rod.
I have no idea... but whatever would be the most understanding way to make a cursor program by cursor program i mean just be able to print and move a cursor around i seen my uncle do it he just used text or something it seemed very understanding but i wasn't into C but i am now.
I guess you didn't notice that most GUIs can have two cursors. Of course you didn't specify whether the program should run under X, or any other GUI interface. I think you need to think things through a bit, then reformulate your question.
--- rod.
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
In C you have to group and terminate statements with '{', '}' and ';'. In English we use periods ('.'), commas (',') and CAPITALS for that purpose. Maybe if you did as well we actually could understand your question.
In general terms, curses is a package used to control cursors and other screen elements. ncurses is a specific implementation of curses, and is included with many Linux distributions. libcurses is the C-callable library that implements the functionality of curses.
BTW, cursors are generally not created by user applications, but are merely controlled by them. Depending on the platform upon which the application runs, the cursor may be implemented in the video hardware. The things you can control would be attributes such as row & column position, size, shape, blinking/rate, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.