The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 shortcut??
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

byrdin

France
18 Posts

Posted - 02/03/2003 :  03:47:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
hi there

is there any way of assigning to an often used labtalk script a shortcut key? maybe via a custom button?
mice-waving drives me crazy. thanx for hints.
martin

easwar

USA
1965 Posts

Posted - 02/03/2003 :  09:01:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Martin,

A good start could be to place your script in the file Custom.ogs that can be found in the main folder of the Origin installation. Then you can run your script any time by clicking on Custom Routine button on the Standard Toolbar, the one that looks like a flow chart.

You can then look in the Origin manual andd/or the product help files for the section "Creating a Button that Performs a Custom Task", to learn more about creating your own custom buttons.

If you have version 7, your custom button could call an Origin C function - you can have your custom Origin C functions load and compile automatically any time Origin launches, and access them from you buttons.

Easwar
OriginLab.


Go to Top of Page

byrdin

France
18 Posts

Posted - 02/03/2003 :  09:18:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
that is all allright and fine, but finally i still need to press the button (by mouse) and not the shortcut key (on the keyboard ), which was the aim of the game

sorry if my question was unclear.martin
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 02/03/2003 :  10:16:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Marten,

You can't create keyboard shortcuts in Origin. The closest you can get is to define a macro with a short name...

def m1 {
-- labtalk commands --
};

Then run the macro by entering its name in the script window. You'll have to keep the script window open and handy at all times in order for this to useful, but you might try it out.

Mike Buess
Origin WebRing Member
Go to Top of Page

greg

USA
1379 Posts

Posted - 02/03/2003 :  10:59:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The LabTalk menu command supports shortcut keys, but we don't have support for accelerator keys anywhere. The difference can be seen in the Print menu option. You can access this option with Alt-F, then P (which is the shortcut sequence) or via Ctrl-P (which is the accelerator key sequence).
Here is an example that sets up a new menu option under Tools to run a custom routine:

menu -w;
menu ?To;
menu -i 11 (&My Spiffy Tool) {run.section(custom,main);};

I could then access my custom routine with Alt-T, M.
The ampersand in front of 'M' simply tells windows to underline the 'M' and use it as a shortcut. According to Window's rules for shortcuts, if you use a letter more than once, then the shortcut key cycles through each option and you must use 'Enter' to execute.
In the above example, had I executed:

menu -w;
menu ?To;

menu -i 11 (My Spi&ffy Tool) {run.section(custom,main);};

then the 'f' key would be my shortcut - which 'conflicts' with the 'Fit Comparison' menu option - and my sequence becomes Alt-T, f, f, Enter.

Go to Top of Page

byrdin

France
18 Posts

Posted - 02/04/2003 :  03:54:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanx greg,
that does the job fine.
where do you think is the best place to include that
menu defing piece of code to make it permanent?
thanx martin
Go to Top of Page

greg

USA
1379 Posts

Posted - 02/06/2003 :  4:11:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can add your code to FULLMENU.CNF.

When Origin starts, it reads the ORIGIN.INI file including the following:
Reads NumLevels from the Config section.
This is the number of menu levels available under Format : Menu
Read a menu Title# and File# list to determine which CNF files to process for each menu level.
Reads Level from the Options section to determine the active menu level and - therefore - which CNF files to read.


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000