summaryrefslogtreecommitdiff
path: root/clients/keyboard.c
Commit message (Collapse)AuthorAgeFilesLines
* clients & tests: Unify multiple definitions of x*alloc and related functionsBryce Harrington2016-03-171-0/+1
| | | | | | | | | | | | | Direct fail_on_null calls now produce output like: [weston-info] clients/weston-info.c:714: out of memory xmalloc, et al produce output on failure like: [weston-info] out of memory (-1) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Use input method protocol from wayland-protocolsJonas Ådahl2015-11-191-82/+92
| | | | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* Use text input protocol from wayland-protocolsJonas Ådahl2015-11-191-6/+6
| | | | | | | Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Update boilerplate from MIT X11 license to MIT Expat licensesBryce Harrington2015-06-151-16/+17
|
* remove trailing whitespacesMichael Vetter2015-05-151-7/+7
| | | | | Remove trailing whitespaces because they are not needed and jumping to the end of al ine should do just that and not jump to the whitespace.
* keyboard: do not crash when input panel is not availableOlivier Blin2014-09-171-0/+5
| | | | | | [Pekka Paalanen: whitespace fix] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* clients: Initialize label in keyboard handling codeBryce W. Harrington2014-05-091-1/+1
| | | | | | | | | Quells warning: clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’: clients/keyboard.c:556:11: warning: ‘label’ may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* keyboard: add the missing symbols layout, fix arabic layoutManuel Bachmann2014-04-161-121/+159
| | | | | | | | | | | | | | The "symbols" modifier key of weston-keyboard is no longer inactive, but will provide an additionnal layout with numerals and special characters. Fix the Arabic keyboard, which was rendering out of the bounds, and now use the Arabic IBM PC keyboard as a reference for its standard and new symbols layouts. https://bugs.freedesktop.org/show_bug.cgi?id=71757 Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
* Make sure config.h is included before any system headersAndrew Wedgbury2014-04-071-0/+2
| | | | | | | | | | | | | | | There was an issue recently in screen-share.c where config.h was not being included, resulting in the wrong definition for off_t being used on 32 bit systems. I checked and I don't think this problem is happening elsewhere, but to help avoid this sort of problem in the future, I went through and made sure that config.h is included first whenever system headers are included. The config.h header should be included before any system headers, failing to do this can result in the wrong type sizes being defined on certain systems, e.g. off_t from sys/types.h Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
* keyboard: Make debug output less verboseKristian Høgsberg2014-01-091-4/+17
| | | | | | | The keyboard is too chatty, make it use a dbg() function for logging which defaults to disabled. Also drop a noisy fprintf() in input_panel_configure().
* keyboard: Don't strcat() into a strdup()ed stringKristian Høgsberg2014-01-091-4/+20
| | | | | | | We need to reallocate the memory to hold the entire concatenated string, but strcat() doesn't do that. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
* keyboard: Fix insert_text() string utilityKristian Høgsberg2014-01-091-5/+6
| | | | | | | | strncat() into a newly allocated buffer isn't well-defined. I don't know how this didn't crash all the time, getting blocks from malloc() with a NUL in the first byte must be fairly common. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=71750
* keyboard: Handle touch up eventKristian Høgsberg2014-01-071-9/+21
| | | | | | This fixes arrow keys which trigger on button up. Closes: https://bugs.freedesktop.org/show_bug.cgi?id=73169
* keyboard: Add rudimentary touch support to keyboard.Brian J Lovin2013-09-031-0/+43
| | | | | | | | At this time there is no way to have a key be activated when touch_up is called, so all this patch does is activate they key on touch_down. Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
* keyboard: Don't use next_utf8_char() to go back where we came fromKristian Høgsberg2013-08-151-11/+1
| | | | | | We go one utf8 char back and then one forward. Just remember the original position instead, which also avoids a warning about potentially dereferencing a NULL return value from next_utf8_char().
* malloc + memset -> zallocPeter Hutterer2013-08-081-3/+1
| | | | | | And for clients using the xmalloc helper, use xzalloc. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* clients: use xmalloc in more placesBrian Lovin2013-08-071-2/+2
| | | | | | For the clients continue to use xmalloc() to simplify OOM-handling. Signed-off-by: Brian Lovin <brian.j.lovin@intel.com>
* keyboard: Fix offsets when deleting textJan Arne Petersen2013-05-061-5/+85
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Rename input_method to wl_input_methodJan Arne Petersen2013-05-021-81/+81
| | | | | | | | Also rename input_method_context to wl_input_method_context, input_panel to wl_input_panel and input_panel_surface to wl_input_panel_surface. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Rename text_input to wl_text_inputJan Arne Petersen2013-05-021-5/+5
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: Remove unneded callsJan Arne Petersen2013-05-021-16/+0
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: delete text on commit_stringJan Arne Petersen2013-05-021-0/+3
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Fix serial handlingJan Arne Petersen2013-05-021-14/+9
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add output argument to set_toplevelJan Arne Petersen2013-05-021-16/+10
| | | | | | Allow to specify an output for a toplevel input panel surface. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add "none" preedit-styleJan Arne Petersen2013-05-021-1/+1
| | | | | | | Use "default" preedit style as default. "None" is used when the composing text should look like non-composing text. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Rename text_model to text_inputJan Arne Petersen2013-05-021-5/+5
| | | | | | Also rename text_model_factory to text_input_manager. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: Reset state on activateJan Arne Petersen2013-05-021-6/+28
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add example for language/text directionJan Arne Petersen2013-05-021-3/+86
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add language and text-direction to protocolJan Arne Petersen2013-05-021-23/+31
| | | | Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* Pass argc pointer to parse_options()Kristian Høgsberg2013-02-201-1/+1
| | | | | This lets us keep argc up to date as the backend picks out arguments from the argv array.
* text: Split out cursor_positionJan Arne Petersen2013-02-151-2/+4
| | | | | | | | | | | Add an extra cursor_position, which also allows to change the anchor (for slections). Change the index type to int to allow setting it before the beginning of a commited string. The cursor should not be moved as a direct repsonse to this event but atomically on the next commit_string event. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add commit requestJan Arne Petersen2013-02-151-11/+24
| | | | | | | Allows for atomic state changes. Updated surrounding text, content type and micro focus is taken into account all at once at commit. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Move input_panel interface to input-methodJan Arne Petersen2013-02-151-5/+6
| | | | | | | | | | | Move the input_panel interface from desktop-shell to input-method (since it is not really tied to desktop-shell). Add an input_panel_surface interface like wl_shell_surface to make it easier to extend it. Also add a parameter to the set_toplevel request to be able to specify where to show an input panel surface on the screen. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: add support for invoke_actionJan Arne Petersen2013-02-151-6/+26
| | | | | | Set the pre-edit cursor on the clicked index on invoke_action. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: Add support for a numeric layoutJan Arne Petersen2013-02-151-16/+110
| | | | | | | Add support for a numeric key layout, which is used for some numeric content purpose types. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: Add support for pre-edit stylingJan Arne Petersen2013-02-151-24/+61
| | | | | | | Adds a button to the keyboard to support different styles of pre-edit styling. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: add serial argument to text protocolJan Arne Petersen2013-02-151-2/+18
| | | | | | | The serial argument will allow to ignore outdated events from before a reset request. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: add pre-edit styling support to protocolJan Arne Petersen2013-02-151-4/+12
| | | | | | | | Also add a separate preedit-cursor event and add a commit argument to preedit-string to allow to support commit on reset. Fix editor and keyboard example to adapt to the protocol changes. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Send more information with keysym eventsJan Arne Petersen2012-11-271-9/+35
| | | | | | | | | Send state and modifier from the demo keyboard with the keysym event and take them into account in the editor example. Add some helper functions to write and read a modifiers_map array. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Rename and extend text_model key eventJan Arne Petersen2012-11-271-14/+26
| | | | | | | | | Rename the key event in text_model to keysym and add serial, time and modifiers arguments. Add a modifiers_map event to transfer an array of 0-terminated modifier names, so that a mapping of modifiers to the modifier bit mask is possible. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: commit preedit before sending key eventsJan Arne Petersen2012-11-081-8/+24
| | | | | | Commit the current preedit text before sending control key events. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* Update to new fd and wl_registry APIsKristian Høgsberg2012-10-101-6/+7
| | | | | This commit updates the clients and the wayland compositor backend to use the new wl_registry mechanism and the thread safe fd API.
* keyboard: Avoid access beyond end off bufferRob Bradford2012-10-091-3/+3
| | | | | | | | | | If the for loop does not match on a button it will fall through and try and dereference into the array using the terminating value of the loop. This terminating value of the loop is the dimension of the array and thus beyond its bounds. Cc: Jan Arne Petersen <jpetersen@openismus.com> Signed-off-by: Rob Bradford <rob@linux.intel.com>
* keyboard: Allow backspace for pre-edit textJan Arne Petersen2012-09-251-0/+5
| | | | | When there is a pre-edit text delete the last character of the pre-edit text with the backspace key.
* editor, keyboard: Add support for arrow keysJan Arne Petersen2012-09-251-4/+28
| | | | | Add support for arrow keys on the virtual keyboard and make it possible to move around the cursor in the editor example.
* text: Add reset requets to protocolJan Arne Petersen2012-09-121-0/+18
| | | | | | | | | Add a reset request to the text_model interface and a reset event to the input_method_context interface. Use it to reset the pre-edit buffers in the example keyboard when the cursor is moved in the example editor client. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add support for control keys to the protocolJan Arne Petersen2012-09-121-0/+4
| | | | | | | | Add key event to the text_model interface and a key request to the input_method_context interface. Implement it in the example editor client and the example keyboard. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add delete_surrounding_text to protocolJan Arne Petersen2012-09-121-0/+4
| | | | | | | | | Add delete_surrounding_text event in the text_model interface and the request in the input_method_context interface. Implement it in the example editor client and in the example keyboard so that the backspace key works with it. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* text: Add support for pre-edit stringJan Arne Petersen2012-09-121-3/+21
| | | | | | | | | Add support of preedit-string to the example editor client. Also add a preedit_string request to the input_method_context interface and use that in the example weston keyboard to first create a pre-edit string when entering keys and commit it on space. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>
* keyboard: Use a qwerty virtual keyboard layoutJan Arne Petersen2012-09-121-35/+171
| | | | | | | Add support for a proper qwerty virtual keyboard layout with lowercase and uppercase state, space and enter button. Signed-off-by: Jan Arne Petersen <jpetersen@openismus.com>