Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 months ago.
Improve this question
Someone help me with some logitech or autohotkey script, where when pressing the right mouse button, it also presses the left mouse button, this will last until I release the right mouse button!
This script is for Logitech.
CapsLock LED must be ON.
local LMB_pressed
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 2 and IsKeyLockOn("capslock") then
PressMouseButton(1)
LMB_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 and LMB_pressed then
LMB_pressed = false
ReleaseMouseButton(1)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(1)
end
end
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
Running emacs 28 On win10:
I'd like to see code for ~/.emacs that makes emacs start in ~/ unless otherwise
directed from the command line.
For instance: If I start emacs by pressing the start menu, and then typing e m a c s
I want to be sure it starts in my home directory unless I type
e m a c s
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I use MATLAB R2012b, and for some reason occasionally when I put "bad stuff" in the command line, it executes, but then the --> arrow thing besides the $$f_x$$ symbol disappears and I can't do anything in the command line.
For instance if I write an if statement with nothing else, it erases that arrow thing.
That's because you're starting a loop. It's waiting for you to type the code to go within the loop, and it is terminated when you type end to end the loop. For example:
if(x==0)
y = y + 1;
end
When you see this it typically means that you did not finish a command yet. This most commonly occurs with statements like for or if.
Example:
if 1
Now you are inside the if statement, and not simply at the basic prompt. Therefore you will not see anything happen. This can be tested by continuing with:
1+1 %Normally outputs 2
Obviously nothing happens. You now have two choices. Either you realize that the if was there by mistake, and you cancel with CTRL+C. In this case you will not see any output. Of course you can also choose to finish the statement:
end
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have been trying to rid myself of the bad habit of key-chording in Emacs using only one hand. That is, for C-x I want to use my right pinky to hit the right-Ctrl and a left-hand finger to hit x. My question is how do I type efficiently in all caps? For example, when I type an environment variable such as RAILS_ENV=test it's very tedious to switch between left and right hands holding Shift every time the key falls on the opposite side of the keyboard. It would seem that this is an ideal case for using CapsLk, but I've long remapped that key to Ctrl because of the scarcity of its use and potential for accidental triggering.
I found this related question but it deals more with enforcing the habit than the question of how to actually type efficiently using the opposite hand to hit modifier keys.
As the question appears to be targeted towards bash command lines, you can use Control-A Meta-U to capitalize the first word of the line, useful for typing
env_var=value some_command ...
prior to converting it to
ENV_VAR=value some_command ...
Instead of making CAPS LOCK an additional CTRL, you could simply swap CAPS LOCK and LEFT CTRL.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I want to create a new text file by right click -> New -> New text document using AutoHotKey. How do I do this? I am new to AutoHotKey.
Edit:
Using Autohotkey, you can assign shortcut for some tasks such as running a particular program like Notepad. You do so by writing scripts. You can find the details on the Autohotkey website. I want to write a keyboard shortcut to manually automate the "right click -> New -> New text document" functionality.
I figured out that it could be done by adding the following script to to AutohotKey's existing script.
^+t::
Click, right, 1024, 355 (or any other mouse co-ordinates for that matter)
Send w
Send t
return
However, this syntax wouldn't work when I tried. Could someone tell me what's wrong and tell how should be the correct syntax?
As Ken White said you already have that built in Windows Explorer, Right click > New > New Text Document, so it's kinda pointless having another one doing the same thing.
However, if you want to use AutoHotKey to create a new text file more efficiently and faster then i would recommend this script
SetTitleMatchMode RegEx
MsgBox, 64, NewTextFile, USAGE: When in a folder in Windows Explorer press Ctrl + Shift + T to create empty text file.`nIf you press multiple times, multiple files will be created (e.g. NewTextFile0.txt, NewTextFile1.txt)
#IfWinActive ahk_class ExploreWClass|CabinetWClass
^+t::
NewTextFile()
return
#IfWinActive
NewTextFile()
{
WinGetText, full_path, A
StringSplit, word_array, full_path, `n
Loop, %word_array0%
{
IfInString, word_array%A_Index%, Address
{
full_path := word_array%A_Index%
break
}
}
full_path := RegExReplace(full_path, "^Address: ", "")
StringReplace, full_path, full_path, `r, , all
IfInString full_path, \
{
NoFile = 0
Loop
{
IfExist %full_path%\NewTextFile%NoFile%.txt
NoFile++
else
break
}
FileAppend, ,%full_path%\NewTextFile%NoFile%.txt
}
else
{
return
}
}
When you have this running and you are in a folder using Windows Explorer (or Desktop) press Ctrl+Shift+T to create New text files, as many as you'd like.
https://github.com/ilirb/ahk-scripts/blob/master/executable/source/NewTextFile.ahk
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Emacs + AUCTeX provides all sort of commands for formatting text, but I can't find a way to "unformat" a snippet of code (unless undoing the change right after having run a formatting command).
For example, suppose you have the following snippet with LaTeX formatting
foo \whatever{bar} quux
I'd like to remove the \whatever{} wrapper by selecting the relevant text, or by placing the cursor at its beginning/end, and using a key combination to get
foo bar quux