Keyboard shortcut to capitalize last word

Discuss the word processor
Post Reply
mfrasca
Posts: 2
Joined: Tue May 13, 2014 2:05 pm

Keyboard shortcut to capitalize last word

Post by mfrasca »

I'd like to capitalize the last word I just typed, not because it's at the beginning of a sentence, just because I forgot to hold the shift key pressed while typing the first letter and after I see the effect on screen I decided I'd like to capitalize the word anyway and I don't want to have to go to back, select and retype.
is there any way to do that other than writing my own macro and assign it to whatever key I like?
LibreOffice 4.2.3.3 - ubuntu 14.04
User avatar
RoryOF
Moderator
Posts: 35203
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: keyboard shortcut to capitalize last word

Post by RoryOF »

Just select the word by double clicking in it and /Format /Change Case.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
mfrasca
Posts: 2
Joined: Tue May 13, 2014 2:05 pm

Re: keyboard shortcut to capitalize last word

Post by mfrasca »

well, I understand that this is possible, but I'm typing and while I type the mouse is disabled... I really prefer a keyboard quick action, like two or three key-presses.
LibreOffice 4.2.3.3 - ubuntu 14.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: keyboard shortcut to capitalize last word

Post by acknak »

You could, in theory, record a macro to do it.

In my experience, it's often impossible to record a macro that works properly for different contexts.
AOO4/LO5 • Linux • Fedora 23
FJCC
Moderator
Posts: 9619
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: keyboard shortcut to capitalize last word

Post by FJCC »

This macro might be a start towards what you want to do. I only did a little testing. It capitalizes the first letter of the word before the view cursor and properly handled an intervening space or punctuation in my test.

Code: Select all

oText = ThisComponent.Text
oCurs = oText.createTextCursor()
oVC = ThisComponent.CurrentController.ViewCursor
oCurs.gotoRange(oVC.Start, False)
oCurs.gotoPreviousWord(False)
oCurs.goRight(1,True)
oCurs.String = UCase(oCurs.String)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
gerard24
Volunteer
Posts: 958
Joined: Sat Oct 30, 2010 5:12 pm
Location: France

Re: keyboard shortcut to capitalize last word

Post by gerard24 »

well, I understand that this is possible, but I'm typing and while I type the mouse is disabled... I really prefer a keyboard quick action, like two or three key-presses.
On LibreOffice only:
If the cursor is at the end of the word to capitalize,
Ctrl+Shift+← (left arrow) select the last word,
Shift+F3 change the case. (this is a toogle button for change case: word → Word → WORD → word ...etc)
LibreOffice 6.4.5 on Windows 10
FJCC
Moderator
Posts: 9619
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: keyboard shortcut to capitalize last word

Post by FJCC »

Similar to gerard24's method, in OpenOffice you can go to the menu Tools -> Customize -> Keyboard, set the Category to Format and the Function to Capitalize Every Word and assign a shortcut to that. You can then use CTRL + Shift + LeftArrow to select the word and your new shortcut to capitalize it.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
mmarques
Posts: 2
Joined: Fri Jan 30, 2015 3:48 pm

Re: Keyboard shortcut to capitalize last word

Post by mmarques »

Select the text and use the shortcut Shift+F3 to swap between the different case options.

Cheers,
LibreOffice 4.2.8.2 on Fedora 20 Linux
Bill
Volunteer
Posts: 8952
Joined: Sat Nov 24, 2007 6:48 am

Re: Keyboard shortcut to capitalize last word

Post by Bill »

I don't have LO at the moment. Is it really necessary to select the entire word to change the case? I would think that a press of the left arrow key to move the insertion point into the word would suffice.
AOO 4.1.14 on Ubuntu MATE 22.04
mmarques
Posts: 2
Joined: Fri Jan 30, 2015 3:48 pm

Re: Keyboard shortcut to capitalize last word

Post by mmarques »

If you don't have the mouse to use, just go to the start or end of the word and select it with the shift key pressed. Once selected use shift+F3 to toggle the case of the word. It will first put every letter in lower case, then if you press again it will put the first letter in uppercase and the rest in lower, and with the third press it capitalizes all the letters.

AFAIK, it works with Word and OpenOffice, although I've switched to LO long time ago.

Regards,
LibreOffice 4.2.8.2 on Fedora 20 Linux
Post Reply