[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC] Text Input Management System
From: |
Kazunobu Kuriyama |
Subject: |
[RFC] Text Input Management System |
Date: |
Wed, 31 Mar 2004 18:58:44 +0900 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 |
Hi,
I'm now developing a text input management system described in Apple's
document:
http://developer.apple.com/documentation/Cocoa/Conceptual/InputManager/index.html
The system primarily handles keyboard events, interpreting them and
turning them
into text or command (some of NSResponder's methods) for editable text
views such
as NSTextView and NSTextField. In addition, the system is highly
configurable;
key bindings are easily modified by editing/creating one or two text
files with
an appropriate format, and, by writing your own input server, you get full
control over the text input management.
The system mainly consists of three classes: NSInputManager,
NSInputServer, and
NSTextView (or any views which conform to the NSTextInput protocol).
In GNUstep, we already have these classes; however,
(1) NSInputManager doesn't accept a file format of key-bindings as seen in
http://developer.apple.com/documentation/Cocoa/Conceptual/BasicEventHandling
/Tasks/TextDefaultsAndBindings.html ,
(2) Although our current NSInputManager and NSInputServer classes conform to
the protocol(s) specified for constituting the system, the actual
implementations
of the required methods are stubs. Accordingly, they won't work as
described
in Apple's document.
(3) Because of (2), our NSTextView isn't made so smart yet as that of Cocoa.
Consequently, we can't fully enjoy the rich functionality as promised in
Apple's
document.
To address these problems, my general idea is to divide the problems
into the
following four phases to conquer them:
(1) Give real implementations to NSInputManager and NSInputServer, and
provide
a replacement of the current input system.
(2) Modify NSApplication and NSResponder in such a way that they accommodate
the coming input management system. (An input server is designed to be
launched from the main menu of an application. Thus NSApplication is
included. )
(3) Write a fully featured input server fulfilling the requests (or messages
specified by the NSInputServiceProvider protocol) from one or more text
views
conforming to the NSTextInput protocol. Such a server would be a prototype
of the so-called "platform input server", or language-specific server, and
encourage developers to write input servers for their own languages.
(4) Write an input server for my own language. Technically, this implies
that getting GNUstep to talk with a conversion server[1] directly, thereby
eliminating the dependency on the front end program for the X input method.
As Phase 1 is about to be finished, I decide to make it public officially
to ask evaluation on it. Currently, it's just a replacement of the current
input management system. So there's not anything new but only future's
possibility.
If you have some interest in it, could you try it and send me either
comments
or suggestions or both? I'd highly appreciate your valuable cooperation.
Of course, those who can help the development techniclly are always welcome.
As the modification I've done is relatively extensive, I can't offer it in a
form of diff. So, to get the source, download it from -gui's branch
named kazunobu_input_management. The branch is derived from 0.9.1.
That version
of -gui should be installed with the same procedure as that of the genuine
-gui.
For trying the text input management system, you don't need to do anything
special. Just run an application having an editable text view. After
launching an application, an experimental input server, PlainInputServer,
should automatically begin to run, like other GNUstep deamons.
The server program should be installed
$GNUSTEP_SYSTEM_ROOT/Library/InputManagers.
(If this is not the case, the server won't be launched automatically. Launch
it manually from the console. Or install the server bundle under
$GNUSTEP_USER_ROOT/Library/InputManagers.) To change key bindings, edit
$GNUSTEP_SYSTEM_ROOT/Library/InputManagers/StandardKeyBinding.dict, or
create
a file $GNUSTEP_USER_ROOT/Library/KeyBindings/DefaultKeyBinding.dict.
The latter
overwrites the former. As shown in the names, these files hold
NSDictionary data.
For the format, take a look at StandardKeyBinding.dict. Nested dictionaries
are allowed to use. "One key binding for dispatching multiple methods" is
not supported.
Thanks,
- Kazunobu Kuriyama
[1] A server which converts a sequence of characters you can type in
with a keyboard into characters which are not found on the keyboard.
- [RFC] Text Input Management System,
Kazunobu Kuriyama <=