[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Clasm keybinders, 0.8



Hello ZZDev!

Let me first introduce myself; I'm Vesa Kaihlavirta, the newest addition to   
the Jyväkylä GZigzag team. I started on the project at late autumn 2001. I
a am CS student at the University of Jyväskylä. 



I've been working on a Clasm implementation of the 0.8 keybinder routines.
The current 0.8 keybinder is 99% Java-code/1% Clasm-code, and when my work
is done, those numbers have changed places.

The goal is high flexibility, which will be realized by separation of code
from the data. The keybinder clasm-routine essentially traverses through a
list of cells that contain strings that match with keys that the Java JVM
feeds it. Those cells have their correspondent actions (clasm code
implementing that certain key) connected on a dimension. (Probable problem:
we bind ourselves to Java by doing this)


As usual, pictures tell the story better, so here is an ASCII-graph showing
an example of the keybindings in ZZ-space.

This can be found also at
http://vegai.cjb.net/projects/gzigzag/keybinder.txt and a drawed/scanned
version at .../keybinder.jpeg as soon as I get myself near a scanner.
  

Shared 
keybindings
                   PP Specific
 |---|
 | a |-{clasm for  |--|
 |---|\ "a}        |PP|
   |   \           |--|
 |---|  \            | 
 | b |-..\|-| |-| |-|| 
 |---|    | |-| |-| ||     Client specific
   |      |-| |-| |-|\            
 |---|           \   |\    |------|
 | c |-..         \  | \   |Client|
 |---|             \ |  \  |------| 
   |                \|   \    |
   .                |-|   \   |
   .                | |    \  |
   .                |-|     \ |  
                     |       |-|
                     |       | |
                     |       |-|
                     |        |
                     |    |------|
                     |    |Ctrl-H|--{clasm code for  
                     |    |------|   Client-specific 
                     |        |      "go home"}
                     |        .
                 |------|     .
                 |Ctrl-H|--{clasm code for    
                 |------|   PP-specific
                     |      "go home"}
                     .     
                     .     
                     .        

Here, we use the third dimension for "common" or "shared" keybind lists,
since different views and clients probably will share most bindings (a-z,
A-Z to name not-so-few).
                              
                              
                              
The algorithm(call it X) for the inner keybinder loop would roughly be like
this:

1. Get next cell on d2 => A.
2. If there is something on step(A, d3, -1):
	- get endcell of that cell on d1 => B
	- do algorithm X on step(B, d3, -1)  
3. If A is not an empty cell:
	- check if pressed key matches the string on this cell
	- if it does, eval the code on step(A, d2, 1) 



I'm not sure how the choice of the keylist (in the example, PP/Client) will
be made runtime. From Java or Clasm? Would a clasm-solution there be
unnecessarily complex when compared to a java-solution?

-- 
V.K.