{"id":27635,"date":"2023-01-22T04:31:58","date_gmt":"2023-01-22T12:31:58","guid":{"rendered":"https:\/\/www.podfeet.com\/blog\/?p=27635"},"modified":"2023-01-22T04:31:58","modified_gmt":"2023-01-22T12:31:58","slug":"stream-deck-down-the-rabbit-hole-part-2","status":"publish","type":"post","link":"https:\/\/www.podfeet.com\/blog\/2023\/01\/stream-deck-down-the-rabbit-hole-part-2\/","title":{"rendered":"Stream Deck \u2014 Down the Rabbit Hole, Part 2"},"content":{"rendered":"<p>When we left our hero at the end of <a href=\"https:\/\/www.podfeet.com\/blog\/2022\/12\/stream-deck-down-the-rabbit-hole-part-1\">Part 1<\/a>, he\u2026 I\u2026 had a working set of controls for my NanoLeaf lights. Once I had my buttons working, I decided I wanted to have some nice images to place on them to make the actions clear, and which were nice to look at.<\/p>\n<p><a href=\"https:\/\/developer.apple.com\/sf-symbols\/\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-27636 size-medium\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/screen-symbols-large_2x-300x188.png\" alt=\"A selection of Apple's SF Symbols icons (image by Apple Inc.)\" width=\"300\" height=\"188\" srcset=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/screen-symbols-large_2x-300x188.png 300w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/screen-symbols-large_2x-768x480.png 768w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/screen-symbols-large_2x-650x407.png 650w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/screen-symbols-large_2x.png 876w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>The icons provided as standard in the Stream Deck software are very limited, so I decided to look at the third party icon pack add-ons which can be accessed through the Stream Deck app. When I looked, there were 61 packs available, but many, even most, were either geared towards particular applications, like Adobe After Effects, or followed some kind of theme like the \u201cHorror icons\u201d pack. I looked at a few packs and none were taking my fancy. Then I spotted a quartet of packs based on Apple\u2019s \u201c<a href=\"https:\/\/developer.apple.com\/sf-symbols\/\" target=\"_blank\" rel=\"noopener\">SF Symbols<\/a>\u201d iconography.<\/p>\n<p>If you pay attention to Apple\u2019s WWDC, you may be familiar with these. Apple\u2019s software and many third party applications on Apple platforms use these icons which are part of the Apple operating systems. The four sets available for the Stream Deck comprised the four different colour styles offered by Apple. I downloaded the monochrome and colour versions.<\/p>\n<p>SF Symbols contains over 4000 icons so there are plenty to choose from, and these were, in fact still are, my go-to icons for initial setup. However, for my lighting buttons I wanted something much more representative of the devices themselves, and of the subtle differences the buttons represent. Something that clearly shows the resulting light modes. For this, I decided I needed to create my own.<\/p>\n<p>I have long opined that \u201cPhotoshop\u201d is a poorly named piece of software. I no longer use it, but when I did, I very rarely used it for photos. What I used it for <em>a lot<\/em> was graphics work. These days my choice is the Photoshop competitor, <a href=\"https:\/\/affinity.serif.com\/en-gb\/photo\/\" target=\"_blank\" rel=\"noopener\">Affinity Photo<\/a>, although in this case <a href=\"https:\/\/affinity.serif.com\/en-gb\/designer\/\" target=\"_blank\" rel=\"noopener\">Affinity Designer<\/a> is the better tool.<\/p>\n<p>The reason Designer is better is that the graphics on the buttons need to be simple and clear and using vector shapes and tools is a better fit to achieve this. If you only own Affinity Photo, it has enough shape tools to get by but, for example, you cannot combine shapes with boolean operations \u2014 an operation I needed to get one of my key designs to look right.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-27639 size-medium\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/light_icon-300x300.jpg\" alt=\"A composite image showing an illustration of a down-light rendered in Affinity Designer, where half shows the finished design and half shows the skeleton of objects used to create it.\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/light_icon-300x300.jpg 300w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/light_icon-200x200.jpg 200w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/light_icon-650x648.jpg 650w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/light_icon.jpg 768w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>After a little sleuthing I came up with a button size of 72 pixels square. Affinity Designer can actually size its documents in pixels which makes the final exports very simple. You can also switch to pixel mode to get an idea of how the final result will look, although they are only about 13 mm square on the Stream Deck so you can get away without worrying about this as long as you don\u2019t use fine lines.<\/p>\n<p>I won\u2019t bore you with how I created my designs \u2014 they range from simple combinations of coloured squares to represent the NanoLeaf Canvas panels, to more involved designs to represent my spotlights that hold the main three NanoLeaf Essentials bulbs. If you have any skills with a graphics application, I strongly recommend you have a go at creating your own. In many cases the buttons will be more pleasing, and more obvious in their function.<\/p>\n<p>The next problem I decided to solve came in the form of my day job. I currently work from home 3-4 days a week and doing so involves spending a fair amount of time in <a href=\"https:\/\/www.microsoft.com\/en-nz\/microsoft-teams\/group-chat-software?ms.url=teamscom&amp;rtc=1\" target=\"_blank\" rel=\"noopener\">Microsoft Teams<\/a>. I have a love-hate relationship with this application. It is, on the whole, quite superior to what came before it in our company, but at the same time it has a significant number of \u201cpaper cut\u201d issues that bug me daily.<\/p>\n<p>The first problem may not be the fault of Teams but, for whatever reason, the mute button on my headset, which had worked consistently for months, recently decided it sometimes wouldn\u2019t. The light on the headset cord, the mute indicator in Teams, and whether or not anyone can hear me, all seem to have a tenuous relationship, such that I am never sure if I am muted or not if I use the headset button.<\/p>\n<p>The solution is to use the mute button in the Teams window, but this can be hard to hit accurately and is next to other buttons I do not want to click by accident. It does have a keyboard shortcut, but that is a bit of a handful and only works if Teams is the current application. When I am on a call this is often not the case. What if I could have a button on my Stream Deck that would mute and unmute Teams no matter what?<\/p>\n<p>While it <em>is<\/em> possible in macOS to send a keypress directly to a specific application \u2014 and this is something I will delve further into in part 3 \u2014 I discovered a simple hack that did the job. Mostly. Many applications will, if already open, respond to an Open request by becoming the active application.<\/p>\n<p>My mute button strung together three actions: Open Teams, Delay for 50 ms, then press <strong>^\u2318M<\/strong>. The 50 ms delay was needed to give Teams time to become the active application. There is a caveat with this approach that I am fairly sure applies ONLY to Teams. Teams is\u2026 special. It doesn\u2019t behave like most Mac apps in that its response to being activated is not always to show its main window and accept input.<\/p>\n<p>I\u2019ve seen this even with a simple <strong>\u2318Tab<\/strong> keypress where the menu bar will change to show Teams is the active application, but macOS does not switch to the only Space that has a Teams window. Some internet sleuthing suggests this is caused by Teams having an invisible window that it uses for call notifications. I first tried this technique with another application and for that it worked without fail.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-medium wp-image-27640\" src=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-300x211.jpeg\" alt=\"Photo of Stream Deck showing buttons used for controlling Microsoft Teams\" width=\"300\" height=\"211\" srcset=\"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-300x211.jpeg 300w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-1024x721.jpeg 1024w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-768x540.jpeg 768w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-1536x1081.jpeg 1536w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-2048x1441.jpeg 2048w, https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-650x457.jpeg 650w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>Having got my mute button working, mostly, I set about finding other keyboard shortcuts in Teams that I could place on my Stream Deck. I added buttons for answering and hanging up calls, sharing my screen, and switching to four of the main areas \u2014 calls, chat, activity, and calendar. Those were all set up the same as the mute button, just with different keyboard actions on each. Then I decided to try addressing another issue I have \u2014 setting my \u2018presence\u2019 status in Teams.<\/p>\n<p>When in the office, I habitually lock my Windows laptop as I leave my desk. This is easily done on Windows by pressing the Windows key with L. This also automatically sets my Teams status to Away. When I\u2019m working from home, there is no need to lock my Mac and I am not in the habit of doing so. When I remember, I manually set my status to Away before leaving my desk, and then inevitably forget to set it back to Available when I return.<\/p>\n<p>Achieving the necessary clicks to change status is fiddly, so I had learned how to do it via the keyboard. Pressing <strong>\u2318\/<\/strong> invokes the command field of Teams (usually), where simply typing \u201cAway\u201d or \u201cAvailable\u201d \u2014 or in fact, just the first two letters of either \u2014 and then pressing Enter changes my status. But I\u2019d still forget quite often when returning to my desk.<\/p>\n<p>The buttons I created to achieve this were quite similar to the earlier ones, but with some extra steps. As before, they started with \u201copening\u201d Teams, delaying for 50 ms, then pressing <strong>\u2318\/<\/strong>. Then I added another delay of 50 ms to allow time for the command field to become active, and finally added a Text action to type in the necessary text of either \u201cAway\u201d or \u201cAvailable\u201d. The Text action has a checkbox that I checked to make it press Enter after typing the text.<\/p>\n<p>So now, subject to Teams responding like a normal application, a single button press would set my status. Having two buttons on my Stream Deck seems to make me forget way less often. Except\u2026 sometimes Teams just stops responding to the <strong>\u2318\/<\/strong>, even if I type it myself.<\/p>\n<p>A final button in this set is simply set to open Teams, in case I haven\u2019t already got it running. For the icons, I have so far just used SF Symbols though I will eventually spend some time to come up with some more recognisable images.<\/p>\n<p>At this point, I still felt like I\u2019d only scratched the surface of the things I could set my Stream Deck to accomplish. I mentioned previously about looking into targeting keypresses directly to applications \u2014 something I have since achieved \u2014 but there are many other areas to be delved into including presenting live information on buttons and having them react automatically to changes on my computer. Believe it or not, part 3 barely touches on this aspect, so there may yet be a part 4!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When we left our hero at the end of Part 1, he\u2026 I\u2026 had a working set of controls for my NanoLeaf lights. Once I had my buttons working, I decided I wanted to have some nice images to place on them to make the actions clear, and which were nice to look at. The [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":27640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[147],"tags":[2674,831,1821,1518,1517,5473,233,4327,5643,5026],"class_list":["post-27635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-posts","tag-affinity-designer","tag-affinity-photo","tag-automation","tag-buttons","tag-design","tag-icons","tag-microsoft","tag-microsoft-teams","tag-sf-symbols","tag-stream-deck"],"jetpack_featured_media_url":"https:\/\/www.podfeet.com\/blog\/wp-content\/uploads\/2023\/01\/IMG_3645-scaled.jpeg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/27635","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/comments?post=27635"}],"version-history":[{"count":2,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/27635\/revisions"}],"predecessor-version":[{"id":27647,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/posts\/27635\/revisions\/27647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media\/27640"}],"wp:attachment":[{"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/media?parent=27635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/categories?post=27635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.podfeet.com\/blog\/wp-json\/wp\/v2\/tags?post=27635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}