[texworks] shortcuts with multiple letters

Z Br breigzach at gmail.com
Sat Mar 18 06:53:32 CET 2017


Ah ok Alain I appreciate the detailed email! No worries, I understand this
is not exactly a high priority issue!

It is a shame there is not a more detailed guide for the shortcuts.ini
file: I am guessing there is a way to do it there. Do TW programmers visit
this listserv?

Oh and one small update: I had not noticed but in Win 7 Alt does in fact
activate the menu but then you need to use arrows to navigate. So for
example to save you could do,
Alt-<downarrow six times>-<enter>
or to undo,
Alt-<rightarrow, to get to Edit>-<downarrow>-<enter>
Obviously not in anyway optimal but another way to navigate

On Fri, Mar 17, 2017 at 3:01 PM, Alain Delmotte <
alain.delmotte at leliseron.org> wrote:

> Hi!
>
> To have the accelerators they could be defined in the translation file.
>
> In the message pointed to by Z Br, I said that I translated the messages
> of TeXworks to French and did add the accelerators for French. I do not
> remember doing this for English. Furthermore, in the latest translation I
> did for French, I did not define them as it is taking quite a long time to
> do.
>
> Humm! I see that Stefan said I did create accelerators for English! (in
> https://github.com/TeXworks/texworks/issues/17#issuecomment-80291247) but
> it was not complete (http://tug.org/pipermail/texworks/2010q2/002606.html).
> Further this was in 2010. For the moment I do not have time to redo the
> work for French(, nor for English). Sorry!
>
> The same for the shortcuts which are not the same as in other programs,
> but those, I think, are hard-written in the code!! (Undo is also Ctrl+Z, at
> least on my system; Save As is Ctrl+Shift+S in LibreOffice!)
>
> You are speaking about the "translations" folder, that you do not find.
> Probably it is not created when you are using an English TeXworks.
>
> So for the moment, I can not help.
>
> Regards,
>
> Alain
>
> Le 17/03/2017 à 02:34, Z Br a écrit :
>
> Thanks Mark but some of the other shortcuts do not work on any other
> program I use:
> Undo = Alt+U
> Save As = Ctrl+Shift+S
> My understanding of the philosophy with TW is to be flexible and allow
> user modification, and that is exactly the spirit of my question
>
> On Thu, Mar 16, 2017 at 6:53 PM, Mark Yagnatinsky <markyag at gmail.com>
> wrote:
>
>> I suggest you learn Ctrl + S.
>> Benefit #1: it's less typing
>> Benefit #2: It also works in every program
>> But even so, it would be nice if this were fixed.
>>
>> On Thu, Mar 16, 2017 at 8:46 AM, Z Br <breigzach at gmail.com> wrote:
>>
>>> Thanks Mark appreciate the efforts!
>>> My hope is to avoid having to learn a new set of shortcuts for just one
>>> program. Hopefully others can give a suggestion for how to do "Alt+F,S" and
>>> other similar keystrokes.
>>>
>>> On Thu, Mar 16, 2017 at 1:39 AM, Mark Yagnatinsky <markyag at gmail.com>
>>> wrote:
>>>
>>>> Re: undo: why not just use Ctrl + Z?  You seem to have memorized all
>>>> the hard-to-use keyboard shortcuts :)
>>>> I spend a few minutes trying to get a script to work.  The good news is
>>>> that I got save working.
>>>> The bad news is that it pops up a dialog box with nothing but the word
>>>> "true".
>>>> Something tells me your muscle memory will NOT like this.
>>>> At this point someone who actually knows something about TeXworks will
>>>> have to take over, because I'm way out of my depth here.
>>>>
>>>> On Thu, Mar 16, 2017 at 12:02 AM, Z Br <breigzach at gmail.com> wrote:
>>>>
>>>>> Sorry for the clutter but here are two more threads discussing
>>>>> accelerators:
>>>>> I was unable to get the attachment in the second file to work, it
>>>>> seems perhaps this is aimed for a Mac?
>>>>> Again perhaps Mark or Alain could help out on this.
>>>>> https://github.com/TeXworks/texworks/issues/17#issuecomment-80291247
>>>>> http://tug.org/pipermail/texworks/2010q2/002606.html
>>>>>
>>>>> On Wed, Mar 15, 2017 at 9:49 PM, Z Br <breigzach at gmail.com> wrote:
>>>>>
>>>>>> And sorry I need to work on my reading comprehension: one of the
>>>>>> important items Mark noted is that what I am looking for is an
>>>>>> "accelerator" (I had not heard of that term before): the Alt key activates
>>>>>> the pull down menus, and if I had that I would be set.
>>>>>>
>>>>>> I did a google search and a few years ago Alain seems to have
>>>>>> discussed this:
>>>>>> http://tug.org/pipermail/texworks/2013q2/005795.html
>>>>>> Item 1 discusses accelerators! Unfortunately the attachments have
>>>>>> been stripped off and I cannot find the directory mentioned there,
>>>>>> c:\users\<your_name>\TeXworks\translations
>>>>>>
>>>>>> So Alain if you are reading this and still have those files, can you
>>>>>> re-post them?
>>>>>>
>>>>>> Thanks again!
>>>>>> Zach
>>>>>>
>>>>>> On Wed, Mar 15, 2017 at 9:32 PM, Z Br <breigzach at gmail.com> wrote:
>>>>>>
>>>>>>> Thanks Mark. I have tried reading though that manual but am puzzled
>>>>>>> as to how to use that to have some key sequence lead the file to be saved:
>>>>>>> like where would I add in the parameters. Sorry like I said I really have
>>>>>>> little programming skill :(
>>>>>>>
>>>>>>> And as an aside yes you are correct in what I am trying for: in
>>>>>>> Microsoft Windows, the standard key sequence for:
>>>>>>> saving files is Alt <and then> F <and then> S;
>>>>>>> or to undo what was just written is Alt <and then> E <and then> U
>>>>>>> Essentially the Alt activates the pull down menu and then the other
>>>>>>> keys navigate the pulldown. So if I can create a shortcut or get a script
>>>>>>> to do this, it will be like virtually every other program I use and will
>>>>>>> speed my editing. I am guessing others in the Windows world would also
>>>>>>> benefit from this, so if I figure out a solution I will be sure to post it
>>>>>>> here!
>>>>>>>
>>>>>>> And finally not sure if there is someone on the mail list who is
>>>>>>> more familiar with the shortcuts. I am guessing there is a way to do what I
>>>>>>> want with the shortcuts.ini file but it is not well documented (what I know
>>>>>>> I pulled from manual, http://formal.korea.ac.kr/~jle
>>>>>>> e/lectures/cnce150/read/TeXworks-manual.pdf, Section A.2)
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Mar 15, 2017 at 7:28 PM, Mark Yagnatinsky <markyag at gmail.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> First off, I never knew about shortcuts.ini before; this is a great
>>>>>>>> feature and needs to be made more discoverable.  I suggest, at a minimum,
>>>>>>>> that a fresh TeXworks installation creates an empty shortcuts.ini file so
>>>>>>>> that someone might wonder what it's for.  Maybe someone should file a
>>>>>>>> feature request.  (Maybe me??)
>>>>>>>>
>>>>>>>> Second, it seems a bit silly that the syntax for shortcuts in
>>>>>>>> shortcuts.ini does not match the syntax for shortcuts for running scripts;
>>>>>>>> surely those should be identical.  Sounds like another feature request.
>>>>>>>>
>>>>>>>> Third: in what world is "Alt + F + S" a familiar keyboard shortcut
>>>>>>>> for saving a file!?!  The only thing I'm aware of that comes even close is
>>>>>>>> "Alt + F, S", which simply opens the file menu, and then selects the save
>>>>>>>> option.  Unfortunately, this doesn't seem to work in TeXworks, since it
>>>>>>>> seems that none of the menus on the menu bar have an accelerator key
>>>>>>>> defined, so Alt + F fails to open the file menu, and even if it did, "S"
>>>>>>>> does not activate save.  Yet another missing feature.
>>>>>>>>
>>>>>>>> Finally, I'm no expert in the TeXworks scripting API, and have
>>>>>>>> written precisely zero working scripts, but this seems to do what you need:
>>>>>>>> http://twscript.paulanorman.info/docs/html/TexWorksQtScripti
>>>>>>>> ng.html?save.html
>>>>>>>> In other words, the script is a one line: TW.target.save();
>>>>>>>> Disclaimer: I have not tried it.  I personally just use Ctrl + S,
>>>>>>>> to save.
>>>>>>>> (Actually, this is not true.  What I actually do is Ctrl + T to
>>>>>>>> typeset, and rely on the implicit save just before typesetting.)
>>>>>>>>
>>>>>>>> Hope some of this helps.
>>>>>>>> If not, ask again.
>>>>>>>>
>>>>>>>> On Wed, Mar 15, 2017 at 12:28 AM, Z Br <breigzach at gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Thanks Alain!
>>>>>>>>>
>>>>>>>>> Unfortunately I am not much of a programmer and so I am unsure how
>>>>>>>>> to modify the script you posted to get the action I had asked about. Could
>>>>>>>>> you give a bit more direction, or if someone else knows if this is possible
>>>>>>>>> with the short cuts file that would be great too.
>>>>>>>>>
>>>>>>>>> ZB
>>>>>>>>>
>>>>>>>>> On Tue, Mar 14, 2017 at 1:32 PM, Alain Delmotte <
>>>>>>>>> alain.delmotte at leliseron.org> wrote:
>>>>>>>>>
>>>>>>>>>> Hi,
>>>>>>>>>>
>>>>>>>>>> I don't think that it is possible with a shortcut*, but you could
>>>>>>>>>> have a script to do that, like this one:
>>>>>>>>>>
>>>>>>>>>> ================================ chapter.lua
>>>>>>>>>> --[[TeXworksScript
>>>>>>>>>> Title: d: chapter \c&hapter
>>>>>>>>>> Description: Encloses the current selection in \chapter{}
>>>>>>>>>> Author: Alain Delmotte from Stefan Löffler & Jonathan Kew
>>>>>>>>>> Version: 0.1
>>>>>>>>>> Date: 2011-11-01
>>>>>>>>>> Script-Type: standalone
>>>>>>>>>> Context: TeXDocument
>>>>>>>>>> Shortcut: Alt+W, Alt+&
>>>>>>>>>> ]]
>>>>>>>>>>
>>>>>>>>>> txt = TW.target.selection
>>>>>>>>>> if (txt == nil) then txt = "" end
>>>>>>>>>> TW.target.insertText("\\chapter{" .. txt .. "}")
>>>>>>>>>> TW.target.selectRange(TW.target.selectionStart - string.len(txt)
>>>>>>>>>> - 1, string.len(txt))
>>>>>>>>>> ============================
>>>>>>>>>>
>>>>>>>>>> To create a \chapter{xyz} instruction I type "xyz", select this
>>>>>>>>>> and type Alt+W& (the key where is "1", but on my belgian keyboard it has &
>>>>>>>>>> as lower case). If I selct nothing I just have \chapter{}.
>>>>>>>>>>
>>>>>>>>>> You have to put the script file in the scripts folder.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>>
>>>>>>>>>> Alain
>>>>>>>>>> * to be confirmed by the specialists
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Le 14/03/2017 à 14:15, Z Br a écrit :
>>>>>>>>>>
>>>>>>>>>> Hi:
>>>>>>>>>>
>>>>>>>>>> I am using a shortcuts.ini file to create some custom shortcuts.
>>>>>>>>>> I would like to have shortcuts which involve multiple letters, e.g. the
>>>>>>>>>> familiar Alt+F+S to save the file. But when I include lines like this in
>>>>>>>>>> shortcuts.ini,
>>>>>>>>>> actionSave = Alt+F+S
>>>>>>>>>> they do not work (literally nothing happens). Shortcuts with just
>>>>>>>>>> one letter like
>>>>>>>>>> actionSave = Alt+S
>>>>>>>>>> do work.
>>>>>>>>>>
>>>>>>>>>> Is there a way to create shortcuts with multiple letters?
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> Zach
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> My setup:
>>>>>>>>>> Win7 Enterprise x64
>>>>>>>>>> TexWorks 0.6.1
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ------------------------------
>>>>>>>>>> [image: Avast logo] <https://www.avast.com/antivirus>
>>>>>>>>>>
>>>>>>>>>> L'absence de virus dans ce courrier électronique a été vérifiée
>>>>>>>>>> par le logiciel antivirus Avast.
>>>>>>>>>> www.avast.com <https://www.avast.com/antivirus>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Garanti
> sans virus. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texworks/attachments/20170318/3c4cecc7/attachment-0001.html>


More information about the texworks mailing list