How to grasp full control of the screen within a c program?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How to grasp full control of the screen within a c program?
I remember that from a very basic BASIC running machine I had that capabilities at hand, by default, since the early '80's.
How can I achieve the same results from c?
For ex., I've seen that there're some codes that render the dominoes pieces or cards as used in poker. I need to use some symbols like those & they need to be placed in the screen at arbitrary locations & orientations. Need to change the background color without loosing any symbol present there already.
It should be possible but I don't know where to look for it. Thanks for any tip/help on this!
Thanks for replying to both of you, dugan & jschiwal!
First to dugan: I'm sorry I was not clear enough, so lets try to correct that right now. Somewhere some months ago I was trying to have a keyboard enabled to write all the characters in English AWA in Spanish. A fellow told me that with a Ctl+U+"a 4 number with the keypad (maybe with Alt+#) I should be able to obtain any character desired. Right now I'm having a mess in my system & tried to obtain a few of them but its faults disable me to obtain any. I hope that with the info offered above you will know of what I was speaking of.
Now to jschiwal: I made a quick search of what you said & now I'm convinced that it wont be specially easy. First of all, I need to fix my system because I tried to run some simple c programs that were running smoothly before but the system respond with:
"no a command" type message.
I'll be posting back anything new that happens with all this in about a week or sooner...hope so!
I can't see how this question is related to your first post. Anyways, to write Unicode characters the proper key combination is Ctrl+Shift+u, then type in the four digit number, you don't need the keypad or pressing a different key, just type in the number.
The Unicode glyphs used above are U+2665, U+2666, U+2663, and U+2660 respectively. To control the location, you could use ANSI escape sequences, but it is a bit tricky.
I recommend using the ncursesw library instead. The *w version has support for "wide" characters, allowing you to use Unicode glyphs with ncurses. The ncurses programming howto is available in the ncurses-doc package, and for example here. Ncurses itself is almost always installed, but you might have to install the ncurses-dev package containing the development headers for writing new ncurses programs.
Like TobiSGD said, you can also type those glyphs by typing Ctrl+Shift+U, 2, 6, 6, 5, Ctrl. The final Ctrl can be any meta-key, as it just switches back to the normal node. Note that you only keep Ctrl and Shift depressed for the U, not for the numbers. Use the Character Map accessory available in most Linux desktop environments to search for specific glyphs; it also lists the Unicode code point.
Thanks for replying to both of you, TobiSGD & Nominal Animal!
I'm sorry I didn't include the whole wording (unicodes) because I lost the grasp of the word at the time of posting. For ex., if you enter <Ctl+Shift+U + 9856> you should obtain something resembling half of the tile (0:1) in the dominoes game. So, it had some relationship with the 1st post.
I went to a site showing the ANSI character maps & screen controls but my console isn't able to do anything logical out of it. I think it has to do more with the mess I created when trying to delete some d/l program (Glade, I think) from Seamonkey File Finder, one or more libs needed by my system & possibly other files got deleted by myself: many entries from my menus aren't present anymore or for those still there some simply do nothing.
I'll keep the info both of you posted handy for trying them after I fix the system.
For ex., if you enter <Ctl+Shift+U + 9856> you should obtain something resembling half of the tile (0:1) in the dominoes game.
I do believe you need to type in the hexadecimal value, not the decimal value. 9856 = 0x2680, and <Ctrl+Shift+U>2680<Shift> produces ⚀ for me. You can see if your terminal or console supports these Unicode glyphs by running command
Originally Posted by Benny7440
one or more libs needed by my system & possibly other files got deleted by myself
Oh. If you have a Debian variant (Debian, Ubuntu, Mint), you can run
It reports a few false positives (cups, gir1.2-dee-0.5, policykit-1, and policykit-desktop-privileges, on my system), does not detect files that are dynamically created at installation time, and does not check every single installed package, but it should catch anything obvious. You can reinstall affected packages using
sudo apt-get install --reinstall packages...
but note that some packages may overwrite any custom configuration you have done with their default configuration files.
On the other hand, if you can back up your files, doing a clean reinstall now and then feels refreshing
I mean, you get rid of old stuff you no longer need, and remove any backward compatibility packages lingering around (complicating things, just because you originally installed the machine years ago). While most distributions do QA, they normally only do that for a clean install. Reinstalling now and then -- especially after a critical mishap -- helps you avoid any corner cases. Considering the importance of backing up now and then, and the ease of installation of current Linux distributions, I think a good nice clean reinstall every year or so is not such a bad idea, overall. For me, the main point is making sure I have good backups, though; otherwise I tend to not bother, really. (I do use RAID-1 for my documents.)
Yes. I do believe you'll save yourself a lot of grief if you can just do a clean reinstall. Just save all your files onto some other media (USB sticks, DVD-R's), and check you have everything before wiping the disk. As it happens, Ubuntu 12.04 LTS (five-year support span) was just released, so installing that one from scratch makes a lot of sense.