I'm in an ergonomic sort of mood, and realizing that I waste many precious milliseconds by lifting my hands up from the letter keys over to the arrow keys in order to move my cursor. Is there a handy alterate way to move the cursor I can access in Textmate?
Generally, I'm looking for ways to keep my head up more while programming. I'd like to, for example, be able to copy an entire line into the clipboard without lifting my fingers. Can textmate take me where I want to go, or should I start thinking about making a move to Vim or some such?
ctrl+f moves cursor one character forward
ctrl+b .. and backward
(hold alt/option to skip by word)
ctrl+a beginning of line
ctrl+e .. and end of line
ctrl+n move to next line
ctrl+p .. and to previous
Related
I'm trying to get some bog standard code to work on my Logitech G910 keyboard. It's nothing much...mostly it is used to help edit a shopping list on a website. To help remove one item at a time I simply have it left click, replace the current number (single digit item) with a 0, move the mouse relative to the right, click, press the up key five times, and move it relative back to the left so that it's in position.
Now I am well aware that I could just as easily change the code to move the mouse somewhere on the screen, and that's all well and good, but since this is a learning opportunity for me, I might as well exploit it for all it's worth for latter use in the future. That said this is the headache I'm having...when the cursor is moved relative to it's location on the screen that's one value, but to move it back into position that's a different value, or in this case if it's moved 100 to the right, it has to be moved -65 to the left to be in the same position. This, of course, makes no sense what-so-ever.
To add to the problem, as if this wasn't bad enough on it's own, the cursor doesn't always end up in the same place when the code is ran. Sure...it will be in place on the first execution of the code, but on the second it's out of place, third it might be in place, and the fourth it might be out of place, etc. While this is all a headache, I can at least say this much: when it comes to using relative commands it sure is nice to have it, especially where using an arrow key won't place it in the exact position it needs to be in. Slightly off mark? No problem...just have it go up -2 on the y axis and it's all golden. :D
That aside, to make things a little easier, here is the snippet of code that I am using.
if (event == "G_PRESSED" and mkey == 1 and arg == 3) then
--Delete the value and replace with a 0 on site
PressAndReleaseMouseButton(1)
Sleep(100)
PressAndReleaseKey("backspace")
PressAndReleaseKey("0")
Sleep(100)
MoveMouseRelative(100, 0)
PressAndReleaseMouseButton(1)
Sleep(100)
PressAndReleaseKey("up")
PressAndReleaseKey("up")
PressAndReleaseKey("up")
PressAndReleaseKey("up")
PressAndReleaseKey("up")
Sleep(200)
MoveMouseRelative(-65, -2)
end
I have been using Sublime 2/3 together with Skim for Latex for a long time, however, since I have a lot long derivations (equations which is half-page long), I found it is annoying when I use backward sync to jump back to tex file.
For example, I have a five-line align environment in Latex, and I want to correct one line of it. If I press command+shift+left mouse click on Mac for backward search, the cursor jumps to the end of align environment instead of the correct line.
I found my colleague uses TexStudio on Windows and the backward search works perfect, so I wonder if it is possible to improve the backward search for Sublime+Skim. I really like Sublime so I don't wanna switch to another Latex editor.
Totally new with Corona and asking for some support.
Would like to create a simple first software with Corona. My idea is to have a button and when you press the button you see different words on the screen. The idea is that they roll randomly and then stops on one word. For example 8 different words and one is chosen and a few seconds and shown on the screen.
For an expert I guess this is imple but for a rookie it´s not that easy.
Use a array of words to store the words
local words = {foo, bar, hi, no, yes, mom, dad}
Then use math.random to select a word.
local wordIwant = math.random(#words) -- # operador gets the length of a list
So if math.random returns 3 for example, wordIwant will be "hi"
:)
Now how you do your special effect and other pretty stuff, is up to you, but I recommend using the enterFrame listener for that.
I am a beginner at ActionScript3, and for my learning purpose, I am trying to build a match3 kind of game. I am making is a clone of bejeweled kind of game. but instead of swapping, I have to delete those elements and shift the upper elements down and add new elements above those shifted elements.
I am able to delete matched elements and after matching I'm removing those elements but I am stuck with the shifting code. I am not able to shift those elements down.
I believe that you should take a look at Richard Lord's Tetris source code as your game may be somehow similar in mechanics to Tetris. Tetris shifts down rows when you get lucky.
Richard Lord is one of the Flash Gurus and his way of doing things may seem pretty advanced for a starter like you. Take a look over the source code and see if it fits you. What I can tell is that this is the proper way to make a game but maybe it's not the best point to start for a novice like you that is in urgent need.
http://www.richardlord.net/blog/actionscript-3-tetris-source-code
I would approach it like this in 2 parts.
Loop through your array of board positions starting from the bottom row and check for an empty unoccupied slot, if you find one do another loop through the row above till you find a piece on the same column. If you find a piece on the row above apply a tween to move it down to the empty slot and continue your loop.
Once you have looped through all rows, and animated all the tweens you need to loop through again to find all the gaps that need gems dropped into them. Create new elements at those positions and then move them up by (element height * row), apply another tween to animate them back to their starting position.
What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)?
Did it ever have a key on a keyboard? How did someone generate it?
Is there any language or system still in use today where the vertical tab character does something interesting and useful?
Vertical tab was used to speed up printer vertical movement. Some printers used special tab belts with various tab spots. This helped align content on forms. VT to header space, fill in header, VT to body area, fill in lines, VT to form footer. Generally it was coded in the program as a character constant. From the keyboard, it would be CTRL-K.
I don't believe anyone would have a reason to use it any more. Most forms are generated in a printer control language like postscript.
#Talvi Wilson noted it used in python '\v'.
print("hello\vworld")
Output:
hello
world
The above output appears to result in the default vertical size being one line. I have tested with perl "\013" and the same output occurs. This could be used to do line feed without a carriage return on devices with convert linefeed to carriage-return + linefeed.
Microsoft Word uses VT as a line separator in order to distinguish it from the normal new line function, which is used as a paragraph separator.
In the medical industry, VT is used as the start of frame character in the MLLP/LLP/HLLP protocols that are used to frame HL-7 data, which has been a standard for medical exchange since the late 80s and is still in wide use.
It was used during the typewriter era to move down a page to the next vertical stop, typically spaced 6 lines apart (much the same way horizontal tabs move along a line by 8 characters).
In modern day settings, the vt is of very little, if any, significance.
The ASCII vertical tab (\x0B)is still used in some databases and file formats as a new line WITHIN a field. For example:
In the .mer file format to allow new lines within a data field,
FileMaker databases can use vertical tabs as a linefeed (see https://support.microsoft.com/en-gb/kb/59096).
I have found that the VT char is used in pptx text boxes at the end of each line shown in the box in oder to adjust the text to the size of the box.
It seems to be automatically generated by powerpoint (not introduced by the user) in order to move the text to the next line and fix the complete text block to the text box. In the example below, in the position of §:
"This is a text §
inside a text box"
A vertical tab was the opposite of a line feed i.e. it went upwards by one line. It had nothing to do with tab positions. If you want to prove this, try it on an RS232 terminal.
similar to R0byn's experience, i was experimenting with a Powerpoint slide presentation and dumped out the main body of text on the slide, finding that all the places where one would typically find carriage return (ASCII 13/0x0d/^M) or line feed/new line (ASCII 10/0x0a/^J) characters, it uses vertical tab (ASCII 11/0x0b/^K) instead, presumably for the exact reason that dan04 described above for Word: to serve as a "newline" while staying within the same paragraph. good question though as i totally thought this character would be as useless as a teletype terminal today.
I believe it's still being used, not sure exactly. There might be even a key combination of it.
As English is written Left to Right, Arabic Right to Left, there are languages in world that are also written top to bottom. In that case a vertical tab might be useful same as the horizontal tab is used for English text.
I tried searching, but couldn't find anything useful yet.