Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
French, Catalan, German, Spanish letters - popup menu
#1
Video 
EDITED: This is simple script creates a popup menu, from which you can send French, Catalan, Spanish or German letters. You can easily modify it to use your preferred language and preferred triggers. There isn't much to it, but maybe it can save you some typing. Many thanks to Gintaras for dramatically shortening the code, as shown below.

Ctrl+Shift+Z to activate the popup, Ctrl+Alt+Q to stop the triggers. Modify as required.

There is a zip file attached with the icons used, although you can just as easily use the Editor and add your own. The poor image is the popup menu.
 
Code:
Copy      Help
using Au.Triggers;

script.setup(trayIcon: true);

// Now set some triggers
ActionTriggers Triggers = new();

var hk = Triggers.Hotkey;

hk["Ctrl+Shift+Z"] = o => ShowMenu();
hk["Ctrl+Alt+Q"] = o => Triggers.Stop(); //let Triggers.Run() end its work and return
hk.Last.EnabledAlways = true; // Ctrl+Alt+Q always enabled

Triggers.Run();
print.it("Trigger stopped with " + hk.Last);

void ShowMenu() {
    var m = new popupMenu("SymbolMenu");
    //var m = new popupMenu("4f14a87a-58e5-4bb6-96db-bbc5e6988e21");
    m["Degrees", image: "*WeatherIcons.Degrees #7CCA45"] = o => keys.sendt("°");
    m["See No Evil", image: "*FileIcons.Monkey #FA7C6E"] = o => keys.sendt("?");
    m["Marca Registrada", image: "*Material.RegisteredTrademark #EB085E"] = o => keys.sendt("®");
    m["Trademark", image: "*Material.Trademark #000000"] = o => keys.sendt("™");
    m["Copyright", image: "*ForkAwesome.Copyright #3304EF"] = o => keys.sendt("©");
    m.Separator();
    m.Submenu("Spanish", m => { foreach (char c in "¡¿ÁÉÍÑÓÚÜáéíñóúñ¡ü") m[$"{c}"] = o => keys.sendt(o.Text); });
    m.Separator();
    m.Submenu("Catalan", m => { foreach (char c in "ÀÁÈÉÍÏÒÓÚÜàèéíòóúüÇ窫»€·") m[$"{c}"] = o => keys.sendt(o.Text); });
    m.Separator();
    m.Submenu("German", m => { foreach (char c in "ßäöüÄÖÜ") m[$"{c}"] = o => keys.sendt(o.Text); });
    m.Separator();
    m.Submenu("French", m => { foreach (char c in "ÀÂÄÈÉÊËÎÏÔŒÙÛÜŸàâäèéêëîïôœùûüÇç«»€") m[$"{c}"] = o => keys.sendt(o.Text); });
    m.Show();
}


Attached Files Image(s)
   

.zip   LanguagePopup.zip (Size: 23.95 KB / Downloads: 133)
#2
Suggested changes.

Remove , sleepExit: true

Code:
Copy      Help
    m.Submenu("Spanish", m => { foreach (char c in "¡¿ÁÉÍÑÓÚÜáéíñóúñ¡ü") m[$"{c}"] = o => keys.sendt(o.Text); });
#3
Thanks, Gintaras. I'll work on it.
EDIT: Updated with your suggestions, see OP.
Regards,
burque505


Forum Jump:


Users browsing this thread: 1 Guest(s)