Assign shortcut to a "Saved Function"
-
Hi there,
I want to assign “Ctrl+Shift” to “Text Direction RTL/LTR” (both of them, LTR and RTL). I mean by pressing just “Ctrl+Shift”, text direction changes. But I can’t assign these two keys (Control+Shift), I get the “This will disable the accelerator!” error, it doesn’t work
Is there a way to force NP++ to behave like Microsoft Notepad? In MS Notepad by pressing left Ctrl+Shift the direction goes LTR and by pressing right Ctrl+Shift the direction goes RTL. -
If a single Notepad++ function itself isn’t a “toggle”, then no, this won’t work. Because RTL and LTR are two different functions, they have to have unique keycombos assigned to them.
If you are desperate for this behavior (let us know), then it likely could achieved using a scripting plugin and a short script.
-
@Alan-Kilborn said in Assign shortcut to a "Saved Function":
If a single Notepad++ function itself isn’t a “toggle”, then no, this won’t work. Because RTL and LTR are two different functions, they have to have unique keycombos assigned to them.
If you are desperate for this behavior (let us know), then it likely could achieved using a scripting plugin and a short script.
Thanks. Yes! I want to bring this shortcut to NP++ (from MS NP). Pressing Ctrl+Shift toggles the direction. By every pressing (those keys combination), text direction goes “LTR” OR “RTL”.
-
Actually, you can’t assign Ctrl+Shift to a function in N++. It has to be Ctrl+Shift+something. Is that OK?
-
@Alan-Kilborn said in Assign shortcut to a "Saved Function":
Actually, you can’t assign Ctrl+Shift to a function in N++. It has to be Ctrl+Shift+something. Is that OK?
No! Is that possible to force NP++ to use this shortcut (just Ctrl+Shift)? Why have they disabled such a good shortcut in NP++? My muscle memory has been used to it for changing RTL/LTR direction. I am bilingual and using this shortcut many times in Word and NP.
-
@JamesWebb said in Assign shortcut to a "Saved Function":
Is that possible to force NP++ to use this shortcut (just Ctrl+Shift)?
Yes, clone the repo, make the changes in code and rebuild your own npp.
Why have they disabled such a good shortcut in NP++?
I assume because this is a source of confusion.
Imagine you have Ctrl+Shift as one key combination and Ctrl+Shift+0 as another. When should the Ctrl+Shift key combination take effect? After x milliseconds is too fast for one person and too slow for another. -
@JamesWebb said in Assign shortcut to a "Saved Function":
Is that possible to force NP++ to use this shortcut (just Ctrl+Shift)? Why have they disabled such a good shortcut in NP++? My muscle memory has been used to it for changing RTL/LTR direction.
Eko truly answered this question with this:
Imagine you have Ctrl+Shift as one key combination and Ctrl+Shift+0 as another. When should the Ctrl+Shift key combination take effect?
I suppose Ctrl+Shift (only) works in Notepad.exe (if it does – I can’t verify that) because it has no Ctrl+Shift+something shortcuts that it has to detect.
I am slightly surprised that it would work in Word, because I would think that Word has some shortcuts that are Ctrl+Shift+something.What I was originally suggesting was a script that would work based on pressing Ctrl+Shift+something and toggle between RTL and LTR modes when that same combo was pressed multiple times. I suppose since it can’t be Ctrl+Shift (only), then no script is wanted/needed?
-
@Ekopalypse said in Assign shortcut to a "Saved Function":
…as one key combination and Ctrl+Shift+0 as another
Interesting that you used Ctrl+Shift+0 in your example, given its past history (of not working) in N++. ref
-
@Ekopalypse said in Assign shortcut to a "Saved Function":
@JamesWebb said in Assign shortcut to a "Saved Function":
Is that possible to force NP++ to use this shortcut (just Ctrl+Shift)?
Yes, clone the repo, make the changes in code and rebuild your own npp.
Why have they disabled such a good shortcut in NP++?
I assume because this is a source of confusion.
Imagine you have Ctrl+Shift as one key combination and Ctrl+Shift+0 as another. When should the Ctrl+Shift key combination take effect? After x milliseconds is too fast for one person and too slow for another.My apology Sir!! I didn’t notice your knowledge is beyond my dizzy!!! Because I am not programmer! What a great help! Many thanks you just wasted your time Sir. Please get back to your work Sir.
-
@JamesWebb said in Assign shortcut to a "Saved Function":
My apology Sir!! I didn’t notice your knowledge is beyond my dizzy!!! Because I am not programmer! What a great help! Many thanks you just wasted your time Sir. Please get back to your work Sir.
It is hard to tell if you are being serious or not.
In the event you are serious, there is no apology needed, as this site exists for asking questions, getting answers, and pondering solutions to difficult problems.That all being said, perhaps there IS an acceptable way to implement your desire, again with a scripting plugin. But…you’d have to be willing to hold down Ctrl and Shift together for some predefined period of time. If no additional keypress occurs during that time, the LTR/RTL mode could then be toggled. At least, in theory it could work. Let us know what you think of that.
-
@Alan-Kilborn Many thanks for your time. I am seriously serious now! If you don’t mind and you have time (enough time) for my elementary question (!), check my video (link below) to see that you can change text direction by Ctlr+Shift and change the language with Spacebar+Winkey (or Alt+Shift). I am wondering why you are not aware of that shortcut (absolutely no offence) in NP and Word.
My apology if I bother you (seriously). I know most of the programmers are a bit (!) selfish and they like to just show off their knowledge (!!) on forums!
BTW, my knowledge is a little about boxing (about 18 years in rings! 78 K) and I solve my problem in the real world with real things not in a virtual world.
My apology to you is serious because you took your time to help me. Many thanks again.https://mega.nz/file/Jlp3DRrB#5sDs4dfdegdGyoUb2H_qawN5cuEGABLWWyyScV5NQlU
-
I interpret your response to mean that you were annoyed with my response, if so why exactly?
@Alan-Kilborn
What can I say … of all possible combinations I have used the one, maybe there are more that has problems, oh lord :-D -
@JamesWebb said in Assign shortcut to a "Saved Function":
check my video
Note that many of the regulars here have a strict policy against clicking on random links to such filesharing hosts: anything could be on the other end of that link, including a virus or other malware. Further, for those who are in the forum during they day-job, their I.T. departments likely block such filesharing hosts, so even if they were foolish enough to click on the link on your say-so, they would be blocked.
I am wondering why you are not aware of that shortcut (absolutely no offence) in NP and Word.
Because trying those keystrokes in MS Word and MS Notepad does not change anything for me (and presumably for Alan).
This superuser.com conversation shows that you’re not the only one who has seen
Ctrl+Shift
toggling the direction… but that conversation implies that the direction changes based on which shift key is hit (Ctrl+LeftShift
vsCtrl+RightShift
), not thatCtrl+AnyShift
will toggle the direction.My initial guess is that it requires a Windows setup with multiple keyboards/languages defined (and maybe even one of those languages being a RTL language) for that feature to be available to Notepad. And Notepad++ , being a completely different application not published or coded by Microsoft at all, does not have the insight into the Windows OS internals necessary to intuit that you use that feature in MS apps (whereas MS apps probably have access to better internals and documentation regarding hidden elements of the OS).
You have spent a lot of time apologizing to Alan, but haven’t directly answered his question: are you willing to have a
Ctrl+Shift
toggle for the text direction that would (1) require that you install the PythonScript plugin as well as install a script in that plugin, and (2) require that you hold down theCtrl+Shift
for a “long” period of time (my guess is something on the order of 1-2 seconds). -
@PeterJones
1- About the link, I don’t care if anybody doesn’t like or can’t use them. MEGA is my lovely file-sharing host. If you read my post carefully, you could see I said: “If you don’t MIND!!! (I mean if you LIKE), and have TIME”, you can check the link to see what I am saying about the RTL shortcut in NP and Word. I never FORCE anybody to do something and NEVER had let anybody force me to do something (and I would NEVER let in the future)2- As you are a genius, yes (!), your guess is right! When Alen said he was not aware of that shortcut, my first guess was he had installed just one language (English). The toggle key would be activated if you install another (extra) language on Windows (specifically RTL languages).
3- I think you get me as a foolish-apology-man!!! No bro!!! That apology is because I grew up in a family and I have parents which I kiss their hands day to day. In my region, PERSIA (you call it IRAN!) it’s a normal behaviour here and shows your politeness, not rudeness or foolishness or cowardness!!! They taught me to be polite against anybody older than me. I have to respect his/her age’s number. Using that word is not a symbol of wasting the time to apologise!!! I never owed anybody and would never be! I won’t be annoyed, because I don’t hold annoyance in my brain!!! I’d take care of it (annoyance) by my right (punch) in a millisecond. BTW my right has been crushed, but in the 40s has enough power to respond in millisecond instead of its nanosecond record. If respect bothers you I don’t care. If it annoys you I don’t care at all.
4- Fortunately OR unfortunately English is not my language (native language). If you consider my sentences as wasting the time, it is probably I can’t say that perfectly (fluently) like your natives! I am not a genius like you (!) but as I realized such rubbish things (racism, nationalism, proud of OUR languages!!!, proud of OUR nationality) had disaster consequences like WW#1,#2 and these days it goes to start #3! Humanity always did choose division instead of unification and would choose in the future too! I always have been a hater of these rubbish “-isms”!
My question just started with a simple query! I am an NP++ (portable minimal version) old user. I use that as a simple text editor and a bit more to organizing some files in other formats (that NP++ supports them). If you check them again (all replies), as you are a genius, and your IQ is beyond Einstein’s IQ, instead of punching in a millisecond you would realize every genius instead of replying the answer just explained an Axiom of Choice for me! Maybe I am dumb a bit (!!!), but I am not a donkey! I know if I knew anything about coding, instead of asking about my problem, I would go to download the repo (!!!) to re-compile (if I am saying it correctly!) the app! No need to waste my time to apology you!!!
I hate, absolutely hate cowards people. No offence, don’t take it seriously. Cowards, always know who I am talking about!
Take care. Have a good job day. You just wasted your time for nothing. Your job-time is important to make the world better place for life!!! AoOoO DEAR…
-
Wow. Calm down. We are all trying to help you.
You still haven’t answered Alan’s question, or my rephrasing of it. If you want help, answer the question. If you don’t want help, you don’t have to respond.
-
…haven’t directly answered his question: are you willing to have a Ctrl+Shift toggle for the text direction that would (1) require that you install the PythonScript plugin as well as install a script in that plugin, and (2) require that you hold down the Ctrl+Shift for a “long” period of time (my guess is something on the order of 1-2 seconds).
I think I see a way for requirement (2) to go away, and just a short blip of Ctrl+Shift (down and then up again) to actuate the functionality!
-
@PeterJones said in Assign shortcut to a "Saved Function":
Wow. Calm down.
Don’t tell me “Calm Down”!!!
Chill out boy… in front of your machine!!! You are not here in front of my face to tell me that. -
@Alan-Kilborn
Do you mean by pressing Ctrl+Shift (at the same time) twice? -
@Alan-Kilborn
I forgot to say (!) in MS Word and MS NP by pressing the left Shift+Ctrl the text direction goes left and by pressing the right Shift+Ctrl the text direction goes right. -
Do you mean by pressing Ctrl+Shift (at the same time) twice?
No, I was trying to illustrate that you’d press and release Ctrl+Shift to toggle the direction. It would work on the release, so if you press and held Ctrl+Shift, as long as you didn’t add anything to that – for example the
f
key which would immediately invoke Find in Files – when you release Ctrl+Shift, the desired action would occur.I forgot to say (!) in MS Word and MS NP by pressing the left Shift+Ctrl the text direction goes left and by pressing the right Shift+Ctrl the text direction goes right.
This was brought up by Peter before but you didn’t comment on it; I guess you were consumed with how to reply to Peter’s other statements.
So what do you want…do you want it to work like you say notepad.exe and Word do?:
- LShift+LCtrl = LTR
- RShift+RCtrl = RTL