TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

dynamic macros

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
dorian



Joined: 29 Jul 2012
Posts: 66

PostPosted: Tue Sep 06, 2016 7:39 am    Post subject: dynamic macros Reply with quote

Hi i would like to do something like this:

#var {KEY_F1} {\eOP}

#macro {$KEY_F1} { some actions }

but this not work any ideas why??
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Wed Sep 07, 2016 8:45 pm    Post subject: Reply with quote

Works for me.
Back to top
View user's profile Send private message Send e-mail
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Thu Sep 08, 2016 1:24 pm    Post subject: Reply with quote

If you are on a Mac I know that keys F1-F4 are reserved for some OS functions, there should be some way to release them, but I don't know how
Back to top
View user's profile Send private message
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Mon Sep 12, 2016 6:11 pm    Post subject: Reply with quote

I had a system that I used to use on multiple platforms (Cygwin & Linux) and the codes for many keys (Function, Arrows Keypad. etc.) were different. I used a series of well named #ALIASs to hold the commands I wanted to execute, e.g. when I was running a Map Display on a second PC using the #CHAT and a home-brewed protocol system to load a map from a network shared ramdisk onto the second machine I had this sort of thing:
Code:
#ALIAS        {^KM_AltF11$}
{
   #nop AltF11 macro - switch off external map;
   #if {&{extmapper}}
   {
      #action {^<CHAT> MAPPER chats to you, '0:DEACTIVATE OK'$}{#nop Created by KM_AltF11 macro;#map flag vtmap on;#map flag asciigraphics on;#math topwin {($esr_rows-$
botwin)/2};#unsplit;#split $topwin $botwin;#variable fs_display split;#UNACTION {^<CHAT> MAPPER chats to you, '0:DEACTIVATE OK'$};#nop line gag;ShowInfo}{5};
      #chat {MESSAGE} {MAPPER} {DEACTIVATE:}
   }
}
{5}


and then used a straightforward #ALIAS to create/destroy the short #MACROs for each platform to invoke the corresponding KM_XXXX alias:
Code:
#MACRO        {\e[23;3~}
{
   #nop AltF11;
   KM_AltF11
}
This made it trivial to switch when I changed OS - in fact I think I even ran a #SYSTEM during start-up that detected which was in use and did the #MACRO creation auto-magically. Splitting the key detection from the code it runs like this makes it simpler to manage IMHO.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group