How to disable the console cursor from moving automatically - winapi

Situation:
I am crating an console application for windows using rust. Fore that I use winapi and kernel32.
Lets say my cursor position within the console is at 4,4 (X,Y) then I print an character like print!("#"); at position 4,4. Then the console automatically moves the cursor one to the right 5,4 for the next character to be printed there.
Question
Is it possible to prevent this default behavior, and have the cursor stay at 4,4 instead of moving to the next cell, usingwinapi/kernel32? What I mean by that is that the console should not change cursor position in any case until I manually tell the console to change the cursor position to another cell.
Example or solution maybe in any language.

Related

Cannot move cursor up and down in text area (Firefox 77.0.1 (64-bit), Windows)

In my web app I cannot move the cursor up or down when editing a multi-row text in a simple text area.
The cursor seems to be "locked" to either the first row or the last row. It can be moved left or right normally but not across line breaks.
It is impossible to place the cursor into one of the middle rows. Not by keyboard, and not by mouse either.
The same text area works like a charm in Chrome. I can place the cursor wherever I want and how I want - as expected.
Any idea why this is so and what I can do to fix this?
The text area's css property "user-select" was set to "none". Setting it to "auto" fixed the issue.

Xcode Editor text selection issue

If I want to delete few lines of text in most of text editors, not touching some words on the bottom line and the whole upper line, I put cursor on the bottom row leaving all unnecessary words to the left of the cursor. Then I select few lines vertically by holding Shift + ↑. I stop on upper row and get some selection: part below + right part of the upper row:
In this example I want to get rid of if word and an empty space between the function header and the code, not touching the function header (even hough let will stick to the opening bracket {).
Normally (not in Xcode) I would still hold Shift and will press cmd + ➝ to deselect the right (selected) part or the top row.
Result will be like this:
I can simply press Delete and job is done.
However, in Xcode such shortcut usage makes bottom row fully selected (till the right) and not changes upper row selection:
Same thing happens if you select from top to bottom and you need to remove extra selection from the bottom line.
I tried to rebind shortcuts in Preferences but didn't find a solution.
This example is very particular and maybe not the best, however I face such selection problems only in Xcode and have to use mouse which is not handy.
This is a rather old question, but what you want is fairly simple to achieve. If your cursor is between the if and the let, you would only need to press option-shift-left arrow twice. The first time, it would select the if and the leading tabs, and the second would select the empty line.

how to move the dotted line from the middle of a "alt" sequence diagram

I'm using the UML sequence diagram in gliffy for Jira and I can't seem to move the dotted line to the middle of the alt box - it stays stuck to the top and I don't see a handle for it. How do I move it to the middle?
It's really fiddly but it possible.
1) Double click the top guard condition [If] to go into text edit mode.
2) Add some carriage returns (new lines) at the end - the idea is to move the cursor down to where you want the line to go
If the line doesn't move when you insert the new lines (it's a bit flaky) then click outside the box (to save) and wait a few seconds for it to catch up.
If it still doesn't move the line, then move the shape a little to get it to redraw.
Finally, delete the shape and start again if it still won't move it.
As I said, it's a bit flaky.

Cursor between the wrong characters when clicking an inactive NSTextField with the "Truncate Head" Line Break

I used Interface Builder to create an NSTextField and set its Line Break to Truncate Head (because if its text is too long to display all at once, I'd rather see the last few words than the first few).
My problem is that the modified Line Break compromises my ability to place my cursor in a specific position when making the NSTextField active (a.k.a. First Responder) by clicking the mouse. In this example, the NSTextField is not active, and I attempt to place my cursor between the "L" and "A" in "lazy".
After clicking, the cursor appears before the word "over".
Clearly, the NSTextField is ignoring the modified Line Break, and positioning the cursor as if it were the default. Can I achieve the effect of Truncate Head but keep the ability to place the cursor in a specific location by clicking?
I had the idea to record the mouseDown location, compare that to attributedStringValue's size, and calculate where the cursor should go, but I quickly got in over my head.
Original question: NSTextField keep scrolling at the end
I have the following silly problem:
I placed a single-line NSTextField on my View. The idea would be that it contains a long URL, but in my case mostly the ending is interesting.
So I would like the content to appear like scrolled to the end (so the beginning is not visible if it is longer than the textfield). The problem is that I do not know how to set this properly. I tried the "Text Direction" option to Right To Left which then displays properly, but as soon the user clicks on the field it jumps back to the beginning, thus confusing the user.
Please let me know what I am missing.
Thanks!

Visual Studio - Scroll AND move cursor

As a preface I'm using ViEmu although I dont think this affects anything. I would simply like to scroll up in the Text Editor along with moving the cursor to the relative screen position.
As an example, if my text editor displays 100 lines of viewable code (1 - 100) and my cursor is on line 20, when I scroll down to the next viewable 100 lines (101 -200) I would like the cursor to be at 120.
Using the VS command Edit.ScrollDown scrolls the code down as expected but leaving the cursor at line 20 instead of moving it to 120. Is there another command to use or any way to alter this behavior?
As noted in the question you seem to be wanting to re-map Page Down to another key (due to limited keyboard).
To identify which command a key is mapped to open the keyboard customisation dialogue and type in the current key into the short key text box and then look at what it is currently mapped to.
Unfortunately this doesn't work for page down (control-page down does work, but that doesn't help here).
Entering "page" into the command filter does: Edit.PageDown is mapped to Page Down in the text editor. Map this command to another shortcut.

Resources