Hi Mathias,

* Mathias Bauer <[EMAIL PROTECTED]> wrote:
> Hi Fabian,
>
> Fabian Braennstroem wrote:
>
>> Hi Mathias,
>> 
>> * Mathias Bauer <[EMAIL PROTECTED]> wrote:
>>> Fabian Braennstroem wrote:
>>>
>>>> Hi Eike,
>>>> 
>>>> * Eike Rathke <[EMAIL PROTECTED]> wrote:
>>>>> Hi Fabian,
>>>>>
>>>>> On Tuesday, 2006-11-21 11:22:58 +0100, Fabian Braennstroem wrote:
>>>>>
>>>>>> I saw that it was discussed a couple times before, but 
>>>>>> I was wondering, if there are any plans to achive vim-like
>>>>>> keybindings in openoffice/writer?
>>>>>
>>>>> That probably wouldn't be achievable as Writer has no command mode. Key
>>>>> input without modifiers like Alt or Ctrl is taken as text input.
>>>> 
>>>> Would it be so hard to implement such a command mode. I
>>>> would imagine that a lot of the openoffice developers are
>>>> using vim for their dayly programing and wish to use it when
>>>> using the writer!?
>>>
>>> I assume that it is doable (though I didn't think it through completely).
>>>
>>> OTOH it is a feature only interesting for a minority of users so it's
>>> definitely something that will only happen if a volunteer developer will
>>> do it. Of course I can give some tips how it can be done.
>> 
>> Thanks, I would like to get some tips about how this can be
>> done :-) I assume it has to go deep into the code, and it
>> wouldn't work using python!?
>
> If my idea to implement this works it should be possible with Python.
>
> The idea is to create a UNO object implementing the interface
> com.sun.star.awt.XKeyHandler and register such an object at each Writer
> document view. This enables you to get every key input before it is
> handed over to Writer. The XKeyHandler service has two methods:
>
> boolean keyPressed( [in] KeyEvent aEvent );
> boolean keyReleased( [in] KeyEvent aEvent );
>
> The return value of them tells the caller wether the key input was
> "consumed" or if it may be passed to the usual consumers. I recommend to
> implement both methods and to implement them equally.
>
> Perhaps before we go into further details you should try out wether you
> can implement this in Python (using PyUno), Java or C++. Java
> development should be made a lot easier with our new NetBeans
> integration that has a nice Wizard for UNO components.
>
> Further work will be to register the object using the interface
> com.sun.star.awt.XUserInputInteraction that is provided by the
> Controller object of a Writer window. The best way to get such a
> registration done is to implement a job.
>
> For further discussions please use the [email protected] mailing
> list. A copy of this mail is sent to this list so that you can follow up
> with a reply there.

Thanks for your ideas! I just tried a small basic script
from 'Erik' (he posted the url in the same thread). It works
pretty good with the basic movement, inserting and deleting
functions. Due to the lack of openoffice python knowledge
and of my spare time, I would stick to that. It is just a
few lines long and probably can be converted pretty fast
once I know the appropriate python functions...  which
brings me to a small question. I playing around with some
small python examples from
http://udk.openoffice.org/python/python-bridge.html but
where can I find more? E.g. how could I find the two methods
for keyPressed? Some more interesting functions would be
inserting Graphics, bullets, section names into the writer
or impress document?


Greetings!
 Fabian

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to