holmes4:
Are you writing code for the Arduino at all? What are you realy trying to do? What do you think serialEvent() does?
Mark
Yes, I write code for the Arduino. It also working.
It working but with detour. I use serialEvent outside of my Object and call in the serialEvent function "onSerialEvent". This function "onSerialEvent" is implemented inside of my Object.
I try to do own serial handler which is inherited from HardwareSerial. It must get data from Serial and fire my events.
For example I have sent to serial a stream of bytes 'M' 8 220 123. SerialEvent responded on it then checked if first byte is 'M' then fire the MouseEvent with data (Action = 8, x = 220, y = 123).
I believe I do know how worked the serialEvent.
For example it will be run if Serial get a data. It is perfect for me.
serialEvent() is a function not a method - it must be implemented outside of your class as an ordinary function. If you want it to call a method within your class you need to have a global variable which identifies the class instance and call the appropriate method in that from your serialEvent() function.