Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can I map Alt-F4 to a new, custom key? (Read 2846 times)
MFusion Swing KBoard
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 13
Joined: Apr 22nd, 2019
Can I map Alt-F4 to a new, custom key?
Apr 25th, 2019 at 5:39pm
Print Post  
Is it possible to create a new key that when clicked sent an Alt-F4 from the Virtual Keyboard?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Can I map Alt-F4 to a new, custom key?
Reply #1 - Apr 25th, 2019 at 6:42pm
Print Post  
The ExtendedKey class supports that-
Code
Select All
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); 



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
  
Back to top
 
IP Logged
 
MFusion Swing KBoard
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 13
Joined: Apr 22nd, 2019
Re: Can I map Alt-F4 to a new, custom key?
Reply #2 - Apr 25th, 2019 at 6:48pm
Print Post  
This is AWESOME!  Thanks!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Can I map Alt-F4 to a new, custom key?
Reply #3 - May 16th, 2019 at 12:36pm
Print Post  
This build should now successfully load ExtendedKey objects from layout files -
https://mindfusion.eu/_temp/jvk_extended.zip

Regards,
Slavcho
  
Back to top
 
IP Logged
 
MFusion Swing KBoard
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 13
Joined: Apr 22nd, 2019
Re: Can I map Alt-F4 to a new, custom key?
Reply #4 - Oct 13th, 2019 at 5:55pm
Print Post  
Just saw this today - MANY THANKS!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint