The MindFusion Forums
Virtual Keyboard Components >> Java Swing >> Can I map Alt-F4 to a new, custom key?
https://mindfusion.eu/Forum/YaBB.pl?num=1556213950

Message started by MFusion Swing KBoard on Apr 25th, 2019 at 5:39pm

Title: Can I map Alt-F4 to a new, custom key?
Post by MFusion Swing KBoard on Apr 25th, 2019 at 5:39pm
Is it possible to create a new key that when clicked sent an Alt-F4 from the Virtual Keyboard?

Title: Re: Can I map Alt-F4 to a new, custom key?
Post by Slavcho on Apr 25th, 2019 at 6:42pm
The ExtendedKey class supports that-
[code]
KeyboardLayout kl = KeyboardLayout.create("D:\\BrowserKeyboard.xml");

ExtendedKey ek = new ExtendedKey();
ArrayList<com.mindfusion.keyboard.Key> list = new ArrayList<>();
list.add(Key.ALT);
list.add(Key.F4);
ek.setKeys(list);
ek.setContent("Close");
kl.getKeys().add(ek);

vkb.setTemplateLayout(kl);
vkb.setMode(KeyboardMode.Custom);[/code]

Unfortunately there's an issue with ExtendedKey XML loading code and can't load its instances from xml template file, only adding from code works at this time. We'll try to fix this next week.

Regards,
Slavcho

Title: Re: Can I map Alt-F4 to a new, custom key?
Post by MFusion Swing KBoard on Apr 25th, 2019 at 6:48pm
This is AWESOME!  Thanks!

Title: Re: Can I map Alt-F4 to a new, custom key?
Post by Slavcho on May 16th, 2019 at 12:36pm
This build should now successfully load ExtendedKey objects from layout files -
https://mindfusion.eu/_temp/jvk_extended.zip

Regards,
Slavcho

Title: Re: Can I map Alt-F4 to a new, custom key?
Post by MFusion Swing KBoard on Oct 13th, 2019 at 5:55pm
Just saw this today - MANY THANKS!

The MindFusion Forums » Powered by YaBB 2.6.11!
YaBB Forum Software © 2000-2024. All Rights Reserved.