I am trying to make a microsoft toast notification that has buttons or so called "actions" in this code i have 3 buttons A,B,C and i want to check if any of them are clicked and if so the run a line of code just for example if A is clicked then run debug.log('A') how can i do that? (im new to visual studio and javascript)
document.addEventListener('keydown', logKey);
function logKey(e) {
var notifLib = Microsoft.Toolkit.Uwp.Notifications;
var toastContent = new notifLib.ToastContent();
var toastVisual = new notifLib.ToastVisual();
var toastBindingGeneric = new notifLib.ToastBindingGeneric();
var adaptiveText = new notifLib.AdaptiveText();
adaptiveText.text = "Hello World";
toastBindingGeneric.children.push(adaptiveText);
adaptiveText = new notifLib.AdaptiveText();
adaptiveText.text = "This is a simple toast message";
toastBindingGeneric.children.push(adaptiveText);
toastVisual.bindingGeneric = toastBindingGeneric;
toastContent.visual = toastVisual;
var toastActionsCustom = new notifLib.ToastActionsCustom();
var toastButton = new notifLib.ToastButton("a", "action=at&userId=1");
toastButton.activationType = notifLib.ToastActivationType.background;
toastActionsCustom.buttons.push(toastButton);
toastButton = new notifLib.ToastButton("b", "action=b&userId=1");
toastButton.activationType = notifLib.ToastActivationType.background;
toastActionsCustom.buttons.push(toastButton);
toastButton = new notifLib.ToastButton("c", "action=b&userId=1");
toastButton.activationType = notifLib.ToastActivationType.background;
toastActionsCustom.buttons.push(toastButton);
toastContent.actions = toastActionsCustom;
// Create the toast notification
var toastNotif = new Windows.UI.Notifications.ToastNotification(toastContent.getXml());
// And send the notification
Windows.UI.Notifications.ToastNotificationManager.createToastNotifier().show(toastNotif);
};