× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Robin Coles wrote:
2) Is there a way of defining multiple key actions or other "mini
macros" without having to resort to Java?  E.g. In code I have a key
that maps to shift a block right 3 spaces.  In jLpex I can map a key
that shifts a block right one space, but I can't pass it the number of
spaces to shift, and I can't work out how to repeat the "shift once"
automatically.

Not right now. However, you can try a 'quick and dirty' Java "macro", if you're not inclined to go through developing a plug-in for LPEX extensions, etc. Disclaimer: Quick here is relative, just as you may so consider the dirty part!


1.- Edit a file ThreeRight.java:
======================================================================
import com.ibm.lpex.core.LpexAction;
import com.ibm.lpex.core.LpexView;

public class ThreeRight implements LpexAction {
 public void doAction(LpexView lpexView) {
  int shift = lpexView.actionId("blockShiftRight");
  lpexView.doAction(shift);
  lpexView.doAction(shift);
  lpexView.doAction(shift);
 }
 public boolean available(LpexView lpexView) {
  return lpexView.actionAvailable(lpexView.actionId("blockShiftRight"));
 }
}
======================================================================

2.- Compile with:
  javac ThreeRight.java

Your classpath must include:
  <wdsc install root>\eclipse\plugins\com.ibm.lpex_1.3.8\lpex.jar

3.- Copy the resulting class to the LPEX plug-in directory:
  copy ThreeRight.class
       <wdsc_install_root>\eclipse\plugins\com.ibm.lpex_1.3.8\*.*

4.- In the LPEX "User Actions" preferences, define the new class:
  Name:       threeRight
  Class name: ThreeRight

Now you can call this action from LPEX's command line:
  action threeRight

or bind it to a key from the "User Key Actions" preferences:
  Key:    a-backSpace
  Action: threeRight



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.