Rafael Zingler Posted September 13, 2016 Report Posted September 13, 2016 (edited) Hello, I'm using a virtual keyboard in a project. It's working OK, but sometimes the whole keyboard widget (not only the pressed key) is redrawed. When this happens, the ASCII character (c[0]) returned by the geventEventWait() function is wrong. As long as only the pressed key is redrawed, the returned ASCII code is always correct. I've implemented my own mouse board file, wich included the read_xyz() function. It was not clear to me when this function should return TRUE or FALSE, so until now it returns always TRUE. Can this perhaps cause a different behavior sometimes? Thanks. Edited September 13, 2016 by Rafael Zingler
Joel Bodenmann Posted September 13, 2016 Report Posted September 13, 2016 7 hours ago, Rafael Zingler said: It's working OK, but sometimes the whole keyboard widget (not only the pressed key) is redrawed. When this happens, the ASCII character (c[0]) returned by the geventEventWait() function is wrong. Under which circumstances does the entire keyboard widget get redrawn? That should only happen if visibility and similar things change. If you just press a key on the keyboard (that doesn't change the current layout) it should only redraw that key. Is it possible for you to create a small test-case that allows us to reproduce the problem? 7 hours ago, Rafael Zingler said: I've implemented my own mouse board file, wich included the read_xyz() function. It was not clear to me when this function should return TRUE or FALSE, so until now it returns always TRUE. Can this perhaps cause a different behavior sometimes? That function is supposed to return TRUE if the data in the GMouseReading struct are valid. Otherwise it has to return FALSE. You can have a look at the STMPE811 driver implementation if you'd like to see an example where that function actually can return FALSE under certain circumstances.
Rafael Zingler Posted September 13, 2016 Author Report Posted September 13, 2016 Joel, thanks for your reply. It was a problem in my read_xyz() function. Sometimes, after releasing the touchscreen, my hardware was reading values significantly different when compared with the values generated with the key pressed. When this happens, the problem occurs. I solved it easily in firmware.
Joel Bodenmann Posted September 14, 2016 Report Posted September 14, 2016 I'm glad to hear that everything works as expected!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now