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. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
