diff --git a/Release/Plugin b/Release/Plugin index 3764141..a6b3ca8 100755 Binary files a/Release/Plugin and b/Release/Plugin differ diff --git a/Release/images/accept.png b/Release/images/accept.png new file mode 100644 index 0000000..a2e8d8e Binary files /dev/null and b/Release/images/accept.png differ diff --git a/Release/images/decline.png b/Release/images/decline.png new file mode 100644 index 0000000..6d0c2ec Binary files /dev/null and b/Release/images/decline.png differ diff --git a/Release/images/hand.png b/Release/images/hand.png new file mode 100644 index 0000000..f94f3f2 Binary files /dev/null and b/Release/images/hand.png differ diff --git a/Release/images/hand_raised.png b/Release/images/hand_raised.png new file mode 100644 index 0000000..d54c672 Binary files /dev/null and b/Release/images/hand_raised.png differ diff --git a/Release/manifest.json b/Release/manifest.json index cab666a..bd41db3 100644 --- a/Release/manifest.json +++ b/Release/manifest.json @@ -55,7 +55,47 @@ ], "Tooltip": "Leave the current call", "UUID": "com.doten.teams.end" - } + }, + { + "Icon": "images/decline", + "Name": "Decline Call", + "States": [ + { + "Image": "images/decline", + "Name": "decline" + } + ], + "Tooltip": "Decline incoming call", + "UUID": "com.doten.teams.decline" + }, + { + "Icon": "images/accept", + "Name": "Accept Call", + "States": [ + { + "Image": "images/accept", + "Name": "accept" + } + ], + "Tooltip": "Accept incoming call", + "UUID": "com.doten.teams.accept" + }, + { + "Icon": "images/hand", + "Name": "Toggle Raise Hand", + "States": [ + { + "Image": "images/hand_raised", + "Name": "Raised" + }, + { + "Image": "images/hand", + "Name": "Not raised" + } + ], + "Tooltip": "Toggle Raise Hand", + "UUID": "com.doten.teams.raisehand" + } ], "SDKVersion": 2, "Author": "Mark Doten", diff --git a/Sources/Plugin.swift b/Sources/Plugin.swift index 263b1ab..5f08648 100644 --- a/Sources/Plugin.swift +++ b/Sources/Plugin.swift @@ -40,12 +40,23 @@ public class Plugin: NSObject, ESDEventsProtocol { keystroke = #"keystroke "e" using {shift down, command down}"# break; case "com.doten.teams.end": - keystroke = #"keystroke "b" using {shift down, command down}"# + keystroke = #"keystroke "h" using {shift down, command down}"# + break; + case "com.doten.teams.accept": + keystroke = #"keystroke "s" using {shift down, command down}"# + break; + case "com.doten.teams.decline": + keystroke = #"keystroke "d" using {shift down, command down}"# + break; + case "com.doten.teams.raisehand": + keystroke = #"keystroke "k" using {shift down, command down}"# + break; default: + NSLog("unkown action: \(action)"); break; } - executeAppleScript(source: """ + let script = """ set appName to "\(appName)" if application appName is running @@ -62,7 +73,9 @@ public class Plugin: NSObject, ESDEventsProtocol { activate end tell end if - """) + """ + // NSLog("Script: \(script)") + executeAppleScript(source: script) } public func keyUp(forAction action: String, withContext context: Any, withPayload payload: [AnyHashable : Any], forDevice deviceID: String) { diff --git a/Sources/com.doten.teams.sdPlugin/images/accept.png b/Sources/com.doten.teams.sdPlugin/images/accept.png new file mode 100644 index 0000000..a2e8d8e Binary files /dev/null and b/Sources/com.doten.teams.sdPlugin/images/accept.png differ diff --git a/Sources/com.doten.teams.sdPlugin/images/decline.png b/Sources/com.doten.teams.sdPlugin/images/decline.png new file mode 100644 index 0000000..6d0c2ec Binary files /dev/null and b/Sources/com.doten.teams.sdPlugin/images/decline.png differ diff --git a/Sources/com.doten.teams.sdPlugin/images/hand.png b/Sources/com.doten.teams.sdPlugin/images/hand.png new file mode 100644 index 0000000..f94f3f2 Binary files /dev/null and b/Sources/com.doten.teams.sdPlugin/images/hand.png differ diff --git a/Sources/com.doten.teams.sdPlugin/images/hand_raised.png b/Sources/com.doten.teams.sdPlugin/images/hand_raised.png new file mode 100644 index 0000000..d54c672 Binary files /dev/null and b/Sources/com.doten.teams.sdPlugin/images/hand_raised.png differ diff --git a/Sources/com.doten.teams.sdPlugin/manifest.json b/Sources/com.doten.teams.sdPlugin/manifest.json index cab666a..bd41db3 100644 --- a/Sources/com.doten.teams.sdPlugin/manifest.json +++ b/Sources/com.doten.teams.sdPlugin/manifest.json @@ -55,7 +55,47 @@ ], "Tooltip": "Leave the current call", "UUID": "com.doten.teams.end" - } + }, + { + "Icon": "images/decline", + "Name": "Decline Call", + "States": [ + { + "Image": "images/decline", + "Name": "decline" + } + ], + "Tooltip": "Decline incoming call", + "UUID": "com.doten.teams.decline" + }, + { + "Icon": "images/accept", + "Name": "Accept Call", + "States": [ + { + "Image": "images/accept", + "Name": "accept" + } + ], + "Tooltip": "Accept incoming call", + "UUID": "com.doten.teams.accept" + }, + { + "Icon": "images/hand", + "Name": "Toggle Raise Hand", + "States": [ + { + "Image": "images/hand_raised", + "Name": "Raised" + }, + { + "Image": "images/hand", + "Name": "Not raised" + } + ], + "Tooltip": "Toggle Raise Hand", + "UUID": "com.doten.teams.raisehand" + } ], "SDKVersion": 2, "Author": "Mark Doten",