Defining Touch Bar Buttons for a Windows Application in Parallels Desktop 13

0
Share on FacebookTweet about this on TwitterShare on LinkedInShare on Google+Email this to someonePrint this pagePin on PinterestShare on TumblrBuffer this pageShare on RedditShare on StumbleUpon

In an earlier blog post, I described how to use the Touch Bar with Windows applications. In this follow-up blog post, I will show you how to customize the Touch Bar™ buttons for almost any Windows application—and also describe how the Parallels engineers made the Touch Bar work with Windows. If you haven’t already read that earlier blog post, now would be a good time to do so, since this post will build on several of the ideas explained there. In particular, I will use the great little free utility, Touché, which shows the Touch Bar on the main display.

Parallels Desktop® 13 for Mac pre-defines Touch Bar button sets for the most commonly used Windows applications: Microsoft Office (Word, Excel, PowerPoint, and Outlook), many Windows browsers (Internet Explorer, Microsoft Edge, Google Chrome™, Mozilla, and others), and for some Windows utilities (File Explorer, File Open and File Save dialogs, and more.) However, there are literally tens of thousands of Windows applications used in Parallels Desktop. It was impractical for Parallels to add Touch Bar button sets for this many applications. So we did the next best thing: we gave users the ability to define their own Touch Bar buttons for almost any Windows application. In this blog post, I will show you how to do this, and explain what can and cannot be done with the approach.

Microsoft Notepad is a Windows utility that does not have a predefined Touch Bar button set, so I will use it as my main example. When you launch Notepad, Parallels Desktop just shows the default buttons in the Touch Bar. (See Figure 1.) Let’s fix that.

define touch bar

(Figure 1)

Parallels Desktop 13 has added a menu item to the View menu: “Customize Touch Bar for Notepad.” (See Figure 2.) (Of course, this menu item will change to show the name of the frontmost application in Windows.) When you choose this menu item, the screen will change dramatically. (See Figure 3.) This is the standard Mac® view for customizing Touch Bar buttons for a Mac application, so we decided it was also the best way for a Windows applications. Note that not all Mac applications enable Touch Bar customization. Safari®, Mail, and Notes are three Mac applications that do. You will see this same dramatic screen change when you customize their Touch Bar buttons. Surprisingly, although Keynote®, Numbers®, FaceTime®, Preview, and TextEdit have Touch Bar support, they do not enable Touch Bar customization. Pages® doesn’t even support Touch Bar at all!

define touch bar

(Figure 2)

define touch bar

(Figure 3)

Adding a “Select All” button and a button combo for bold, italics, and underline can be seen in Figure 4.

(Figure 4)

Using these new buttons can be seen in the video in Figure 5.

(Figure 5)

As you saw in Figure 5, the Touch Bar underline button didn’t work at all. To understand why this happened, we have to discuss the underlying implementation of custom Touch Bar buttons in Parallels Desktop 13.

The Custom Touch Bar buttons shown in Figure 3 all work by sending Windows shortcuts to the Windows applications. When you touch the “Select All” button in the custom Touch Bar set for Notepad, Parallels Desktop 13 sends the shortcut “Ctrl-A” to Notepad. Notepad supports this shortcut, and all the text in the document is selected. When you touch the “U” button, Parallels Desktop 13 sends the shortcut “Ctrl-U” to Notepad. As you can see in Figure 6, Notepad has no shortcut for boldface or italics. It doesn’t even have support for underlining text. Thus, when Notepad receives the “Ctrl-U” command, it plays the Windows error tone and does nothing with the text in the document.

Define Touch Bar

(Figure 6)

From this explanation, you can see two requirements for a Windows application to work with the custom Touch Bar implementation in Parallels Desktop 13:

  1. The application must support shortcuts, and
  2. The shortcuts the application supports must follow the Windows standard, as defined in the link above.

While many applications do meet these requirements, many also do not. If either of these two requirements are not met, any custom Touch Bar button you define for that application will not work.

The custom Touch Bar button implementation in Parallels Desktop 13 was chosen so that it would be easy for all users to define custom Touch Bar buttons for many Windows applications. However, that ease of use does come at a price. There are some types of buttons and some application features that cannot be “buttonized” with this approach. My colleague Alexandr Sursiakov has written a blog post – Advanced Touch Bar Customization with Parallels Desktop on a more powerful but less easy-to-use way to define Touch Bar buttons. If you find that the approach defined here doesn’t give you the power you want, please check out his post.

Let us know in the comments how you are using the Touch Bar features in Parallels Desktop 13.

Kurt has been a Mac developer since before the Mac came out. Today he is the Senior Product Manager at Parallels where he works on both Parallels Desktop for Mac and Parallels Access. Prior to Parallels, he was the Senior Mac Evangelist in the Macintosh Business Unit (MacBU) at Microsoft Corp. Kurt is the author of three books and has lectured internationally on object-oriented programming, UI design, and virtualization. Kurt is also a Microsoft Office for Mac and iOS Accredited Support Professional for 2014 and 2015. Outside of work, Kurt has been a fencer for many years, has four times been a member of the US team at the world championships, and has also been the coach of the US team.