Repository: nvaccess/nvda

Issue:
Announce paragraph indent / hanging indent when creating with shortcut keys in Word
In Word:

control+m increases the indent of the current paragraph
control+shift+m decreases the indent

control+t increases the hanging indent (the indent of every line except the first in a paragraph)
control+shift+t decreases the hanging indent

Currently nothing is announced when these keys are pressed.  The paragraph indent is announced when NVDA+f is pressed.



Discussion:
I just want to emphasize that in Portuguese, the ctrl + t command selects all text and does not change alignment.

Thanks Fernando, something to consider.  Is there a Microsoft reference for the Portuguese specific keystrokes do you happen to know?

Good Morning.
I found an article where the shortcut keys for the Brazilian Portuguese is correct.
I found other articles more were some shortcuts with errors.
The major drawback is that the page is in Portuguese.
As a suggestion could translate the page into English using google chrome.
In the article talks about Windows 95, but tested the commands in successfully windows 10.

https://support.office.com/pt-br/article/Atalhos-de-teclado-do-Microsoft-Word-2016-para-Windows-95ef89dd-7142-4b50-afb2-f762f663ceb2

Anyway, I put down a few shortcuts:

new document ctrl+o
open a new file ctrl + a
save ctrl + b
close ctrl + w
copy ctrl + c
paste ctrl + v
cut ctrl + x
select all text ctrl + t
Bold ctrl + n
italic ctrl + i
Underline ctrl + s
center text ctrl + e
align the left ctrl + q
undo ctrl + z
redo ctrl + r
Print ctrl + p
Enable or disable change tracking Ctrl + Shift + E
Find ctrl + l
replace ctrl + u
Switch the letters between uppercase and lowercase Shift + F3
Format all letters as uppercase Ctrl + Shift + A
Underline the words but not the spaces Ctrl + Shift + W 
Apply double underline the text Ctrl + Shift + D
Copy text formatting Ctrl + Shift + C
Apply copied formatting to text Ctrl + Shift + V
Apply 1.5 line spacing Ctrl + 5
Apply the style Title 1Ctrl + Shift + 1
Apply the Heading 2 style Ctrl + Shift + 2
Apply the style Heading 3 Ctrl + Shift + 3
Insert a field DATE Alt + Shift + D
save as f12
Horto fix spelling alt + f7

Hi!

Atention! Not all shortcuts and keystrokes are equal in the european and 
brazilian portuguese versions of Windows, Office and so on...

Sorry, but I didn't notice the first message...

Fernando, can you contact me about this, please?

Rui Fontes

-----Mensagem Original----- 
De: fernando-jose-silva
Data: 5 de setembro de 2016 16:23
Para: nvaccess/nvda
Assunto: Re: [nvaccess/nvda] Announce paragraph indent / hanging indent when 
creating with control+m / control+t in Word (#6269)

Good Morning.
I found an article where the shortcut keys for the Brazilian Portuguese is 
correct.
I found other articles more were some shortcuts with errors.
The major drawback is that the page is in Portuguese.
As a suggestion could translate the page into English using google chrome.
In the article talks about Windows 95, but tested the commands in 
successfully windows 10.

https://support.office.com/pt-br/article/Atalhos-de-teclado-do-Microsoft-Word-2016-para-Windows-95ef89dd-7142-4b50-afb2-f762f663ceb2

Anyway, I put down a few shortcuts:

new document ctrl+o
open a new file ctrl + a
save ctrl + b
close ctrl + w
copy ctrl + c
paste ctrl + v
cut ctrl + x
select all text ctrl + t
Bold ctrl + n
italic ctrl + i
Underline ctrl + s
center text ctrl + e
align the left ctrl + q
undo ctrl + z
redo ctrl + r
Print ctrl + p
Enable or disable change tracking Ctrl + Shift + E
Find ctrl + l
replace ctrl + u
Switch the letters between uppercase and lowercase Shift + F3
Format all letters as uppercase Ctrl + Shift + A
Underline the words but not the spaces Ctrl + Shift + W
Apply double underline the text Ctrl + Shift + D
Copy text formatting Ctrl + Shift + C
Apply copied formatting to text Ctrl + Shift + V
Apply 1.5 line spacing Ctrl + 5
Apply the style Title 1Ctrl + Shift + 1
Apply the Heading 2 style Ctrl + Shift + 2
Apply the style Heading 3 Ctrl + Shift + 3
Insert a field DATE Alt + Shift + D
save as f12
Horto fix spelling alt + f7

## 

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

You can use NVDA's locale specific gesture maps to work around this. 
This has already been done for several other shortcuts in Word for 
various languages.

Changed the title to remove the specific keys and mention when the indent is created with keystrokes.  As discussed these are control+m / control+t in English but vary in other languages.

Resolving patch:
diff --git a/source/NVDAObjects/window/winword.py b/source/NVDAObjects/window/winword.py
--- a/source/NVDAObjects/window/winword.py
+++ b/source/NVDAObjects/window/winword.py
@@ -1307,6 +1307,22 @@ def script_toggleAlignment(self,gesture):
 		if msg:
 			ui.message(msg)
 
+	@script(gestures=["kb:control+m", "kb:control+shift+m", "kb:control+t", "kb:control+shift+t"])
+	def script_changeParagraphLeftIndent(self, gesture):
+		if not self.WinwordSelectionObject:
+			# We cannot fetch the Word object model, so we therefore cannot report the format change.
+			# The object model may be unavailable because this is a pure UIA implementation such as Windows 10 Mail,
+			# or it's within Windows Defender Application Guard.
+			# For now, just let the gesture through and don't report anything.
+			return gesture.send()
+		margin = self.WinwordDocumentObject.PageSetup.LeftMargin
+		val = self._WaitForValueChangeForAction(
+			lambda: gesture.send(),
+			lambda: self.WinwordSelectionObject.paragraphFormat.LeftIndent
+		)
+		msg = self.getLocalizedMeasurementTextForPointSize(margin + val)
+		ui.message(msg)
+
 	def script_toggleSuperscriptSubscript(self,gesture):
 		if not self.WinwordSelectionObject:
 			# We cannot fetch the Word object model, so we therefore cannot report the format change.


Test patch: