Hello
I am trynig to build an extension for the first time
I am using java and eclips idE
But I am having problem with the key events
I implented the XKeyListener to my main class
And override the methods
But it show me no respons is there somthing other than java implementation I should do to make it work
Pleas help me out
Text document key event
Re: Text document key event
You need to use a keyhandler not a keylistener to override events
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Text document key event
thank you so much for answering me
i trayed to switch to the XKeyHandler but still not having any respons
@Override
public void disposing(EventObject arg0) {
// TODO Auto-generated method stub
}
@Override
public boolean keyPressed(KeyEvent arg0) {
// TODO Auto-generated method stub
myFrame.Show();
return false;
}
@Override
public boolean keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
return false;
}
i trayed to switch to the XKeyHandler but still not having any respons
@Override
public void disposing(EventObject arg0) {
// TODO Auto-generated method stub
}
@Override
public boolean keyPressed(KeyEvent arg0) {
// TODO Auto-generated method stub
myFrame.Show();
return false;
}
@Override
public boolean keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
return false;
}
OOo 4.1
win64
win64
Re: Text document key event
There is a keyhandler example at
https://jezzper.com/jezzper/discussions ... 65002B1DA8
You will probably have to translate the code to fit your usage.
https://jezzper.com/jezzper/discussions ... 65002B1DA8
You will probably have to translate the code to fit your usage.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Text document key event
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Text document key event
I don't know Java but here's some code in Basic. You have to return true if you want to stop the event.
Code: Select all
global oXKeyHandler as object
sub StartXKeyHandlerN
dim oDoc
oDoc =thiscomponent
oXKeyHandler = CreateUnoListener("KeyHandler_", "com.sun.star.awt.XKeyHandler")
oDoc.CurrentController.AddKeyHandler(oXKeyHandler)
end sub
sub KeyHandler_Disposing(ev)
end sub
function KeyHandler_KeyPressed(ev) as boolean
if ev.keychar = "I" or ev.keychar = "i" then
KeyHandler_KeyPressed = true
else
KeyHandler_KeyPressed = false
end if
End function
function KeyHandler_KeyReleased(ev) as boolean
end function
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Text document key event
the Basic code worked just fine in macro
so i wonder is there any way to call a java method into macro
if not then how can i generate macro that can connect to mysql database
so i wonder is there any way to call a java method into macro
if not then how can i generate macro that can connect to mysql database
Edit: Topic locked to prevent fragmentation of discussion because maram.j.a has asked the same question in Calling java method in to OOobasic macro |
OOo 4.1
win64
win64
-
- Posts: 318
- Joined: Sun Sep 06, 2020 8:27 am
Re: Text document key event
For the mySQL-Topic you should open a seperate Thread.
I know only the german Version of the Handbook for base,vbut it describes several macros and connections to mySQL.
J.
I know only the german Version of the Handbook for base,vbut it describes several macros and connections to mySQL.
J.
OpenOffice 3.1 on Windows Vista