newbie: designing a new input method

C

C.discussions

Hi,

I am trying to design an input method for a movement notation system.
I have already developed the new font, which contains all the symbols
used in this notation. Now, the task at hand is to select a word
processor, which will be used to enter these sysmbols. Microsoft Word
looked like a good choice for me. However, I have a few queries
regarding the capabilities of MS Word, and wanted to get them clarified
before getting started on it. Please note that this is my first foray
into MS Word app development.

1. This movement notation does not use any of the alphabets found in
the QWERTY keyboard. Instead, it uses around 50 odd symbols. Given
this, I do not require the standard keys i.e A - Z. So, will Word
allow me to map my symbols over the characters A - Z ? If so, can I
write some kind of a script to achieve this.

2. There are some special requirements also. We have a few symbols,
which (depending on the context) can appear on top of each other. Let
me give an example. 3 followed by a 4 should be output as ¾. Same
goes for say 12 followed by 24. At the same time, in some completely
different context, 3 followed by a 4 should be output as 34. This
effectively means that I need a two way input mechanism - a Top to Down
writing method along with the exisitng Left to Right method found in
most editors. Can I get this functionality in Word ?

It would be a great help for me if you could spare some time to ponder
over these questions, and let me know the answers. Do let me know if
you feel that additional information is required to understand the
problem at hand.

Thanks,
Chandan
 
J

Jezebel

1. This movement notation does not use any of the alphabets found in
the QWERTY keyboard. Instead, it uses around 50 odd symbols. Given
this, I do not require the standard keys i.e A - Z. So, will Word
allow me to map my symbols over the characters A - Z ? If so, can I
write some kind of a script to achieve this.


There's rather more to creating a font than simply mapping your symbols to
character values. The mapping part itself is easy: you create your own font,
with your characters inserted with whatever values you choose. Eg, the
symbol you assign to position 65 will appear when you press A. But for this
to work, both Windows and Word need to know the font metrics, in particular
the width. There are plenty of font-creation applications around. Do a
Google. It's a big subject.


2. There are some special requirements also. We have a few symbols,
which (depending on the context) can appear on top of each other. Let
me give an example. 3 followed by a 4 should be output as ¾. Same
goes for say 12 followed by 24. At the same time, in some completely
different context, 3 followed by a 4 should be output as 34. This
effectively means that I need a two way input mechanism - a Top to Down
writing method along with the exisitng Left to Right method found in
most editors. Can I get this functionality in Word ?


No, there's no way to do top-down writing in Word. Either define these
composites as additional characters, which you assign to other character
sequences (control codes or whatever), or experiment with Word's text
positioning fields (EQ, Advance, etc), and create macros to generate field
sequences that produce what you want.
 
C

C.discussions

Hello,

Thanks for your reply. I have a few questions based on those. Could
you please have a look.
1. This movement notation does not use any of the alphabets found in
the QWERTY keyboard. Instead, it uses around 50 odd symbols. Given
this, I do not require the standard keys i.e A - Z. So, will Word
allow me to map my symbols over the characters A - Z ? If so, can I
write some kind of a script to achieve this.


There's rather more to creating a font than simply mapping your symbols to
character values. The mapping part itself is easy: you create your own font,
with your characters inserted with whatever values you choose. Eg, the
symbol you assign to position 65 will appear when you press A. But for this
to work, both Windows and Word need to know the font metrics, in particular
the width. There are plenty of font-creation applications around. Do a
Google. It's a big subject.


2. There are some special requirements also. We have a few symbols,
which (depending on the context) can appear on top of each other. Let
me give an example. 3 followed by a 4 should be output as ¾. Same
goes for say 12 followed by 24. At the same time, in some completely
different context, 3 followed by a 4 should be output as 34. This
effectively means that I need a two way input mechanism - a Top to Down
writing method along with the exisitng Left to Right method found in
most editors. Can I get this functionality in Word ?
No, there's no way to do top-down writing in Word.

My understanding is that you can write Chinese & other oriental
languages in a top down manner. How does Word accomplish that ?
Either define these composites as additional characters, which you assignto other
character sequences (control codes or whatever)

Well I considered this option. But the problem is that I have around
3000 such combinations. Creating 3000 glyphs in a font might not be
feasible.
or experiment with Word's text positioning fields (EQ, Advance, etc), andcreate
macros to generate field sequences that produce what you want.

Could you please elaborate a bit on the above features. What are text
positioning fields, and why are they used ? What do you mean by field
sequences ?

Thanks much,
Chandan
 
J

John Nurick

PMFJI,

It sounds rather as if you need to position your symbols as if they were
on a grid. If so, Word and the other word processors I've used are not
the right tool: without exception they are conceived in terms of
handling streams of text and laying it out on a page in a basically
linear sequence (whether left to right or right to left). Some scripts
(e.g. Chinese) are often written top to bottom, but I'm not aware that
Word can do this. (Reading direction is a much bigger deal in alphabetic
scripts than in ideographic ones, because a change in direction changes
the shape of the words but not of the characters.)

If I'm right about the grid, it might be easier to work with software
that knows about grids: have you thought of using Excel, or a grid
control on a Visual Basic form?
 
C

C.discussions

Hello John,

Actually yes; a grid based system is where I am headed to. At the
moment, this notation is being entered by hand. I have uploaded a
sample manuscript at the following location:

http://chandan.talukdar.googlepages.com/ewmn

If you see, the manuscript is grid based, but the level of granularity
that I need wrt the symbols is somewhat lesser than a cell. That's
because you can have symbols on top of one another within a cell
itself. So, given this, what platform would you recommend me to go
with ?

Thanks,
Chandan
 
J

Jezebel

The Unicode domain allows for over 60000 glyphs in one font.


or experiment with Word's text positioning fields (EQ, Advance, etc), and
create
macros to generate field sequences that produce what you want.

Could you please elaborate a bit on the above features. What are text
positioning fields, and why are they used ? What do you mean by field
sequences ?

Help covers this better than I can.
 
J

John Nurick

Some of those look as if they would be be difficult or impossible in
Excel, so scratch that suggestion.

How fast do you need this to receive keystrokes? Will it be
hunt-and-peck as people transcribe manuscript notations, or do you
envisage flying fingers as a highly-skilled operator notates movements
in real time? If speed is not an issue, I'm pretty sure it could be done
by structuring the grid as a Word table, and using equation fields
within the cells to stack the symbols. But I'm sure the necessary VBA
code would not run fast enough to keep up with a user who has mastered
the notation and is hitting 100-200 keys per minute with a burst speed
=10 strokes per second (equivalent to typing English at 15-30 words per
minute).

To achieve that sort of speed will (I'm pretty sure) require creating an
application from scratch. Doing that would also give you more flexible
control over the user interface than you could achieve in VBA. But it
would be even more programming than a Word-based solution.
 
T

Tony Jollans

I don't know much about this but I'm not sure that Word is the right
starting place at all. I would investigate how (Windows) IMEs work - I
believe at least some scripts are entered via some form of grid to which
Word interfaces somehow. It might be worth asking in
microsoft.public.word.international.features where you might find specific
knowledge on this kind of thing.
 
C

C.discussions

Hello John,

Thank you so much for your reply. Well, the speed of input is not at
all an issue. What we need now is a working tool through which
researchers can input data, and share it with their colleagues (which
till now was being done through scanned images).

I would like to explore your suggested option of using Word tables
along with equation fields. Could you direct me to some reference
book/tutorial, which discusses these techniques. Please note that I
have programmed extensively in C/C++, but this is my first foray into
Visual Basic.

Once again, thanks so much for your advice.

Regards,
Chandan
 
J

John Nurick

Hi Chandan,

What I have in mind - and I've never tried anything like it and am not
sure it will be practical - is something like this:

1) Set up a Word template with a table or tables containing the grids
you need, with an empty { EQ } field in every cell that may need to
contain symbols. To create an empty EQ field, hit Ctrl-F9 and then type
EQ
into the resulting empty field. (Use F9 to update a field, and Shift-F9
to display the field code.) Format the cells to use your special font.

EQ fields are documented in Help; with a bit of practice you'll see how
they work, nesting elements within elements. For example, this
EQ \b \bc\( ( \a \ac \co1 (2,O,T) )
produces the
2
(O)
T
stack in the third Left Arm cell in your sample page.

2) Switch to the VBA editor and insert a new UserForm. The purpose of
this is to sit in the foreground and receive and process keystrokes
(check out the UserForm KeyDown and KeyPress event procedures in Help;
also, hit F2 to bring up the Object Browser and search for
KeyCodeConstants

That's the easy part.

3) Write code that responds to the user's keystrokes. VB/A has a very
flexible Select Case structure.

You'd probably need to capture the navigation keys (e.g. to make the
left and right arrows move between cells rather than within a cell.) The
Word object model makes it reasonably easy to write code to navigate
between and within tables (use the Document's Tables collection and the
Table's Cells, Rows or Columns collections). And if there's one EQ field
in the cell, it's the first object in the cell's Fields collection.
(Alternatively, you may be able to work with the Document's Fields
collection, which will contain all the fields in all the tables.)

I don't know what would be the best way to process the keystrokes that
create symbols for cells. Maybe collect them (or rather the
corresponding characters) in a buffer and attempt to parse this when the
user hits Enter rather than at every keystroke. Either way, you'd parse
the keystrokes, create the corresponding EQ expression, and use this to
update the field.

I'm not aware of grammar and parsing tools for VB/A that remotely match
those C has, but if you're used to programming that way try a web
search. VBScript has a good RegExp object that works find in VBA.

4) If you want two-way editing, there's even more fun in store writing
code to parse the EQ fields...

Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top