1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Virtual (on-screen) keyboard for X
8 HOMEPAGE= http://t-sato.in.coocan.jp/xvkbd/
12 SITES[main]= http://t-sato.in.coocan.jp/xvkbd/
13 DISTFILE[1]= xvkbd-4.1.tar.gz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILD_DEPENDS= imake:single:standard
22 XORG_COMPONENTS= x11 ice sm xaw xext xmu xpm xt xtst
24 LICENSE= GPLv2+:single
25 LICENSE_TERMS= single:{{WRKDIR}}/TERMS
26 LICENSE_FILE= GPLv2+:{{WRKSRC}}/COPYING
27 LICENSE_AWK= TERMS:"^\#include"
28 LICENSE_SOURCE= TERMS:{{WRKSRC}}/xvkbd.c
31 FPC_EQUIVALENT= x11/xvkbd
35 's|/usr/include/|${LOCALBASE}/include/|' ${WRKSRC}/XVkbd-small.ad
37 -e '/define XTEST/s|^XCOMM |#|' \
38 -e 's|.(SHAREDIR)|${PREFIX}/share/xvkbd|' \
42 ${MKDIR} ${STAGEDIR}${PREFIX}/share/xvkbd
45 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/xvkbd
46 ${INSTALL_MAN} ${WRKSRC}/xvkbd.man \
47 ${STAGEDIR}${MANPREFIX}/man/man1/xvkbd.1
50 (cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} \
51 ${LOCALBASE}/bin/xmkmf -a)
53 [FILE:401:descriptions/desc.single]
54 xvkbd is a virtual (graphical) keyboard program for X Window System which
55 provides facility to enter characters onto other clients (software) by
56 clicking on a keyboard displayed on the screen. This may be used for
57 systems without a hardware keyboard such as kiosk terminals or handheld
58 devices. This program also has facility to send characters specified as
59 the command line option to another client.
63 952d07df0fe1e45286520b7c98b4fd00fd60dbf3e3e8ff61e12c259f76a3bef4 408704 xvkbd-4.1.tar.gz
66 [FILE:491:manifests/plist.single]
97 share/man/man1/xvkbd.1.gz
98 share/xvkbd/words.english
101 [FILE:457:patches/patch-Imakefile]
102 --- Imakefile.orig 2020-05-04 07:10:40 UTC
107 XCOMM Remove the next line if you want genuine Xaw instead of Xaw3d
111 XCOMM Remove the next line if you don't want to enable XTEST support
115 XCOMM Remove the next line if you want to disable internationalization
119 SRCS = xvkbd.c findwidget.c
120 OBJS = xvkbd.o findwidget.o
123 [FILE:14689:patches/patch-xvkbd.c]
124 --- xvkbd.c.orig 2020-05-04 04:34:19 UTC
126 @@ -492,8 +492,8 @@ static int altgr_mask = 0;
127 static int level3_shift_mask = 0;
128 static KeySym altgr_keysym = NoSymbol;
130 -static int shift_state = 0;
131 -static int mouse_shift = 0;
132 +static unsigned int shift_state = 0;
133 +static unsigned int mouse_shift = 0;
135 static Display *target_dpy = NULL;
137 @@ -513,6 +513,8 @@ static void PopupFunctionKeyEditor(void)
138 static void DeleteWindowProc(Widget w, XEvent *event, String *pars, Cardinal *n_pars);
139 static void SaveProperty(void);
141 +static void SignalUser1(int dummy);
144 * Search for window which has specified instance name (WM_NAME)
145 * or class name (WM_CLASS).
146 @@ -521,8 +523,7 @@ static Window FindWindow(Window top, cha
149 Window *children, dummy;
150 - unsigned int nchildren;
152 + unsigned int nchildren, i;
156 @@ -846,7 +847,9 @@ static int MyErrorHandler(Display *my_dp
158 static void SendEvent(XKeyEvent *event)
161 static Boolean first = TRUE;
164 if (!appres.no_sync) {
165 XSync(event->display, FALSE);
166 @@ -1157,11 +1160,11 @@ static void SendKeyPressedEvent(KeySym k
169 if (appres.xtest && press_release == 0) {
170 - Window root, child;
171 + Window troot, child;
172 int root_x, root_y, x, y;
175 - XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &mask);
176 + XQueryPointer(target_dpy, event.root, &troot, &child, &root_x, &root_y, &x, &y, &mask);
178 event.type = KeyRelease;
180 @@ -1377,7 +1380,7 @@ static XtIntervalId save_private_dict_ti
182 static void SetDefaultDictionary(void)
184 - strncpy(dict_filename, appres.dict_file, sizeof(dict_filename) - 1);
185 + snprintf(dict_filename, sizeof(dict_filename), "%s", appres.dict_file);
186 XtVaSetValues(props_dict_entry, XtNstring, dict_filename, NULL);
189 @@ -1394,7 +1397,7 @@ static void ReadCompletionDictionary(voi
192 if (strcmp(cur_dict_filename, dict_filename) == 0) return;
193 - strcpy(cur_dict_filename, dict_filename);
194 + snprintf(cur_dict_filename, sizeof(cur_dict_filename), "%s", dict_filename);
198 @@ -1522,7 +1525,7 @@ static void SavePrivateDictionary(void)
200 static void AddToCompletionText(KeySym keysym)
204 struct WORDLIST *node_ptr;
207 @@ -1729,7 +1732,7 @@ static void SendString(const char *str)
209 const char *cp, *cp2;
214 Window target_root, child, junk_w;
216 @@ -1761,8 +1764,7 @@ static void SendString(const char *str)
219 if (sizeof(key) <= len) len = sizeof(key) - 1;
220 - strncpy(key, cp + 1, len);
222 + snprintf(key, sizeof(key), "%s", cp + 1);
223 KeyPressed(None, key, NULL);
226 @@ -1810,11 +1812,12 @@ static void SendString(const char *str)
227 if ('1' <= *cp && *cp <= '9') {
228 usleep((*cp - '0') * 100000);
230 - fprintf(stderr, "%s: no digit after \"\\m\"\n",
231 + fprintf(stderr, "%s: no digit after \"\\D\"\n",
235 case 'm': /* simulate click mouse button */
238 if ('1' <= *cp && *cp <= '9') {
239 if (appres.debug) fprintf(stderr, "xvkbd: XTestFakeButtonEvent(%d)\n", *cp - '0');
240 @@ -1825,10 +1828,18 @@ static void SendString(const char *str)
241 fprintf(stderr, "%s: no digit after \"\\m\"\n",
245 + fprintf(stderr, "%s: this binary is compiled without XTEST support\n",
250 case 'y': /* move mouse pointer */
251 - sscanf(cp + 1, "%d", &val);
252 + if (sscanf(cp + 1, "%d", &val) != -1) {
253 + fprintf(stderr, "%s: no number after \"\\%c\"\n",
254 + PROGRAM_NAME, *cp);
257 target_root = RootWindow(target_dpy, DefaultScreen(target_dpy));
258 XQueryPointer(target_dpy, target_root, &junk_w, &child,
259 &cur_x, &cur_y, &junk_i, &junk_i, &junk_u);
260 @@ -1956,13 +1967,13 @@ static Boolean CheckShiftState(int row,
261 static void RefreshShiftState(Boolean force)
263 static Boolean first = TRUE;
264 - static int last_shift_state = 0;
265 - static int last_mouse_shift = 0;
266 + static unsigned int last_shift_state = 0;
267 + static unsigned int last_mouse_shift = 0;
268 static int last_num_lock_state = FALSE;
269 static Display *last_target_dpy = NULL;
270 - static long last_focus = 0;
273 + static Window last_focus = 0;
274 + unsigned int cur_shift;
275 + unsigned int changed;
276 int first_row, row, col;
279 @@ -2054,7 +2065,7 @@ static void RefreshShiftState(Boolean fo
282 int root_x, root_y, x, y;
284 + unsigned int tmask;
288 @@ -2070,28 +2081,28 @@ static void RefreshShiftState(Boolean fo
289 event.same_screen = TRUE;
292 - XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &mask);
293 + XQueryPointer(target_dpy, event.root, &root, &child, &root_x, &root_y, &x, &y, &tmask);
295 if (strstr(appres.positive_modifiers, "shift") != NULL
296 - && (shift_state & ShiftMask) != (mask & ShiftMask)) {
297 + && (shift_state & ShiftMask) != (tmask & ShiftMask)) {
298 event.keycode = XKeysymToKeycode(target_dpy, XK_Shift_L);
299 event.type = (shift_state & ShiftMask) ? KeyPress : KeyRelease;
302 if (strstr(appres.positive_modifiers, "control") != NULL
303 - && (shift_state & ControlMask) != (mask & ControlMask)) {
304 + && (shift_state & ControlMask) != (tmask & ControlMask)) {
305 event.keycode = XKeysymToKeycode(target_dpy, XK_Control_L);
306 event.type = (shift_state & ControlMask) ? KeyPress : KeyRelease;
309 if (strstr(appres.positive_modifiers, "alt") != NULL
310 - && (shift_state & alt_mask) != (mask & alt_mask)) {
311 + && (shift_state & alt_mask) != (tmask & alt_mask)) {
312 event.keycode = XKeysymToKeycode(target_dpy, XK_Alt_L);
313 event.type = (shift_state & alt_mask) ? KeyPress : KeyRelease;
316 if (strstr(appres.positive_modifiers, "meta") != NULL
317 - && (shift_state & meta_mask) != (mask & meta_mask)) {
318 + && (shift_state & meta_mask) != (tmask & meta_mask)) {
319 event.keycode = XKeysymToKeycode(target_dpy, XK_Meta_L);
320 event.type = (shift_state & meta_mask) ? KeyPress : KeyRelease;
322 @@ -2354,6 +2365,7 @@ static void PropsItemToggled(Widget w, c
323 XtVaGetValues(XtNameToWidget(props_panel, "*integrate_completion_panel"),
324 XtNstate, &appres.integrate_completion_panel, NULL);
326 + /* These two lines generate warnings with -Wbad-function-cast. Grrr. */
327 appres.key_click_duration = (int)XawToggleGetCurrent(click_buttons);
328 appres.autoclick_delay = (int)XawToggleGetCurrent(autoclick_buttons);
330 @@ -2426,7 +2438,7 @@ static void PopupPropsPanel(void)
331 if (props_panel == None) {
332 Widget label, button;
338 props_panel = XtVaCreatePopupShell("props_panel", transientShellWidgetClass,
339 @@ -2560,7 +2572,7 @@ static void OpenRemoteDisplay(Widget w,
340 focused_subwindow = None;
341 if (target_dpy != NULL && target_dpy != dpy) XCloseDisplay(target_dpy);
343 - strncpy(name, (display_name == NULL) ? "" : display_name, sizeof(name) - 1);
344 + snprintf(name, sizeof(name), "%s", (display_name == NULL) ? "" : display_name);
345 for (cp = name; isascii(*cp) && isprint(*cp); cp++) ;
348 @@ -3087,7 +3099,7 @@ static Widget MakeKey(Widget parent, con
349 XtAddCallback(w, XtNcallback, (XtCallbackProc)KeyPressed, (XtPointer)name);
352 - strncpy(str, label, sizeof(str) - 1);
353 + snprintf(str, sizeof(str), "%s", label);
354 if (strcmp(str, "space") == 0) strcpy(str, "");
357 @@ -3158,7 +3170,7 @@ static void MakeKeypad(Widget form, Widg
358 || (strncmp(keypad_shift[row][col], "KP_", 3) == 0
359 && isdigit(keypad_shift[row][col][3])))
360 color = appres.general_background;
361 - strcpy(name, keypad[row][col]);
362 + snprintf(name, sizeof(name), "%s", keypad[row][col]);
363 if (strcmp(name, "Focus") != 0 && strcmp(name, "Num_Lock") != 0)
364 snprintf(name, sizeof(name), "pad%d,%d", row, col);
365 key = MakeKey(keypad_box, XtNewString(name),
366 @@ -3261,12 +3273,12 @@ static void MakeKeyboard(Boolean remake)
367 Widget form, key, left;
370 - Dimension wd, max_wd;
371 + Dimension dwd, max_dwd;
372 int row, col, first_row;
373 char name[50], *label;
374 Widget key_box[NUM_KEY_ROWS];
380 #include "iconify.xbm"
381 @@ -3300,7 +3312,7 @@ static void MakeKeyboard(Boolean remake)
384 for (col = 0; keys_normal[row][col] != NULL; col++) {
385 - strcpy(name, keys_normal[row][col]);
386 + snprintf(name, sizeof(name), "%s", keys_normal[row][col]);
387 if (strcmp(name, "MainMenu") == 0) {
388 Widget iconify_button = None;
390 @@ -3345,8 +3357,8 @@ static void MakeKeyboard(Boolean remake)
391 if (strcmp(name, "space") != 0) snprintf(name, sizeof(name), "%d,%d", row, col);
393 key = MakeKey(key_box[row], XtNewString(name), label, color);
394 - XtVaGetValues(key, XtNwidth, &wd, NULL);
396 + XtVaGetValues(key, XtNwidth, &dwd, NULL);
398 /* keys can be removed by setting its width to 1 */
399 XtDestroyWidget(key);
401 @@ -3382,7 +3394,7 @@ static void MakeKeyboard(Boolean remake)
404 unsigned int wd, ht, bd, dp;
405 - int max_wd, max_ht;
406 + unsigned int max_wd, max_ht;
408 XGetGeometry(dpy, XtWindow(toplevel), &root, &x1, &y1, &wd, &ht, &bd, &dp);
409 max_wd = XtScreen(toplevel)->width * appres.max_width_ratio;
410 @@ -3401,16 +3413,16 @@ static void MakeKeyboard(Boolean remake)
412 if (!appres.debug && key_box[first_row] != None) {
414 - XtVaGetValues(key_box[1], XtNwidth, &max_wd, NULL);
415 + XtVaGetValues(key_box[1], XtNwidth, &max_dwd, NULL);
419 for (row = first_row; row < NUM_KEY_ROWS && key_box[row] != None; row++) {
420 - XtVaGetValues(key_box[row], XtNwidth, &wd, NULL);
421 - if (max_wd < wd) max_wd = wd;
422 + XtVaGetValues(key_box[row], XtNwidth, &dwd, NULL);
423 + if (max_dwd < dwd) max_dwd = dwd;
426 for (row = first_row; row < NUM_KEY_ROWS && key_box[row] != None; row++) {
427 - XtVaSetValues(key_box[row], XtNwidth, max_wd, NULL);
428 + XtVaSetValues(key_box[row], XtNwidth, max_dwd, NULL);
432 @@ -3523,9 +3535,9 @@ static void ReadProperty(void)
433 && strlen(home) + strlen(appres.key_file) + 1 < sizeof(fkey_filename))
434 snprintf(fkey_filename, sizeof(fkey_filename), "%s/%s", home, appres.key_file);
436 - strncpy(fkey_filename, appres.key_file, sizeof(fkey_filename) - 1);
437 + snprintf(fkey_filename, sizeof(fkey_filename), "%s", appres.key_file);
439 - strncpy(dict_filename, appres.dict_file, sizeof(dict_filename) - 1);
440 + snprintf(dict_filename, sizeof(dict_filename), "%s", appres.dict_file);
442 fp = fopen(fkey_filename, "r");
443 if (fp == NULL) return;
444 @@ -3538,9 +3550,9 @@ static void ReadProperty(void)
445 keyboard_layout, getenv("XENVIRONMENT"));
446 if (getenv("XENVIRONMENT") == NULL) layout_selected = TRUE;
447 } else if (sscanf(&str[1], "dict_file %s", key) == 1) {
448 - strncpy(dict_filename, key, sizeof(dict_filename) - 1);
449 + snprintf(dict_filename, sizeof(dict_filename), "%s", key);
450 } else if (sscanf(&str[1], "private_dict_weight %s", key) == 1) {
451 - strncpy(private_dict_weight_value, key, sizeof(private_dict_weight_value) - 1);
452 + snprintf(private_dict_weight_value, sizeof(private_dict_weight_value), "%s", key);
453 } else if (sscanf(&str[1], "%s %d", key, &val) == 2) {
454 if (strcmp(key, "quick_modifiers") == 0)
455 appres.quick_modifiers = val;
456 @@ -3624,7 +3636,7 @@ static void FKeyMenuSelected(Widget w, c
457 else if (strncmp(key, "Shift-", strlen("Shift-")) == 0)
458 snprintf(key2, sizeof(key2), "s:%s", &key[strlen("Shift-")]);
461 + snprintf(key2, sizeof(key2), "%s", key);
463 if (strcmp(cur_fkey, key2) != 0) {
464 if (strlen(cur_fkey) != 0) {
465 @@ -3647,7 +3659,7 @@ static void FKeyMenuSelected(Widget w, c
467 if (cur_fkey_value_mode[0] == 'c') prefix = "!";
468 else if (fkey_value[0] == '!' || fkey_value[0] == '\\') prefix = "\\";
469 - sprintf(sp->value, "%s %s%s", cur_fkey, prefix, fkey_value);
470 + snprintf(sp->value, len + strlen(fkey_value) + 5, "%s %s%s", cur_fkey, prefix, fkey_value);
471 } else { /* empty string - remove the entry for the function key */
473 if (sp2 != NULL) sp2->next = sp->next;
474 @@ -3667,10 +3679,10 @@ static void FKeyMenuSelected(Widget w, c
475 FKeyValueMenuSelected(None, (value[0] == '!') ? "command" : "string");
477 if (value[0] == '!' || value[0] == '\\') value = value + 1;
478 - strncpy(fkey_value, value, sizeof(fkey_value) - 1);
479 + snprintf(fkey_value, sizeof(fkey_value), "%s", value);
480 XtVaSetValues(fkey_value_entry, XtNstring, fkey_value, NULL);
482 - strcpy(cur_fkey, key2);
483 + snprintf(cur_fkey, sizeof(cur_fkey), "%s", key2);
487 @@ -3870,8 +3882,10 @@ static void Autoclick(void)
492 XTestFakeButtonEvent(target_dpy, 1, True, CurrentTime);
493 XTestFakeButtonEvent(target_dpy, 1, False, CurrentTime);
497 static void ShowBalloon(Widget w, XEvent *event, String *pars, Cardinal *n_pars)
498 @@ -4000,7 +4014,9 @@ int main(int argc, char *argv[])
499 Boolean open_keypad_panel = FALSE;
507 argv1 = malloc(sizeof(char *) * (argc1 + 5));
508 @@ -4207,14 +4223,14 @@ char *setlocale(int category, const char
509 if (locale == NULL) {
511 } else if (category == LC_ALL) {
512 - strcpy(old_locale, cur_locale);
513 + snprintf(cur_locale, sizeof(cur_locale), "%s", s);
514 if (locale[0] == '\0') {
515 s = getenv("LC_ALL");
516 if (s == NULL) s = "C"; /* LC_ALL not defined */
520 - strncpy(cur_locale, s, sizeof(cur_locale) - 1);
521 + snprintf(cur_locale, sizeof(cur_locale), "%s", s);
527 [FILE:3567:patches/patch-xvkbd.man]
528 --- xvkbd.man.orig 2020-02-08 11:34:33 UTC
531 -.TH xvkbd 1 2019-09-01
532 +.TH XVKBD 1 2019-09-01
536 \fPxvkbd\fP - virtual keyboard for X window system
540 \fIxvkbd\fP is a virtual (graphical) keyboard program for X Window System
541 which provides a facility to enter characters onto other clients (software)
542 by clicking on a keyboard displayed on the screen.
543 @@ -39,13 +38,13 @@ or you will have serious security risk.
544 It is tested on \fIredhat Linux\fP and \fISolaris\fP,
545 and it will work also on most UNIX-like systems.
547 -This program uses \fIXaw\fP (use of \fIXaw3d\fP is recommended)
548 +This program uses \fIXaw\fP (use of \fIXaw3d\fP is recommended)
549 and no special library is required.
554 -When \fIxvkbd\fP is started, the image of a keyboard
555 +When \fIxvkbd\fP is started, the image of a keyboard
556 will be displayed on the screen.
557 Clicking any key on the \fIxvkbd\fP window will send the character
558 to the focused window
559 @@ -92,10 +91,10 @@ The direction of the pointer motion will
561 .SH " Setting Input Focus"
562 If you are using a window manager and clients
563 -where you can set input focus by clicking mouse button on the window
564 +where you can set input focus by clicking mouse button on the window
565 (and you don't have to keep pointer in the window after that),
566 you can simply set input focus in the normal way
567 -and then click keys on the \fIxvkbd\fP window
568 +and then click keys on the \fIxvkbd\fP window
569 - the character will be sent to the selected position.
571 If you are using a window manager or clients
572 @@ -151,7 +150,6 @@ which can be used to enter Latin charact
574 \fIWord Completion...\fP
575 Open the Word Completion panel.
578 \fIChange Keyboard Layout...\fP
579 Open a popup window to change the keyboard layout.
580 @@ -274,7 +272,6 @@ You may want to set \fIJump Pointer?\fP
582 \fIxvkbd\fP accept following command line options, in addition to
583 general options such as `\fB-display\fP'.
587 Display version information and exit.
588 @@ -353,7 +350,7 @@ If auto-repeat is enabled (this is the d
589 time before start auto-repeat can be set as
590 `\fBxvkbd*Repeater.initialDelay: 600\fP',
591 and period of repeat can be set as
592 -`\fBxvkbd*Repeater.minimumDelay: 100\fP'
593 +`\fBxvkbd*Repeater.minimumDelay: 100\fP'
594 (unit of there parameters are milli-seconds).
596 Resource `\fBxvkbd.autoRepeat: false\fP' has the same function.
597 @@ -453,7 +450,7 @@ Maybe this is useful when problem arises
598 Resource `\fBxvkbd.textDelay: \fP\fIvalue\fP' has the same function.
600 .BI "-window " window
603 (hexadecimal value leaded with `\fB0x\fP', or decimal value),
604 the name (instance name or class name) of the window,
605 or the title of the window to set input focus.
606 @@ -496,7 +493,7 @@ Specify the display (in the meaning of t
609 If this option is specified,
610 -\fIxvkbd\fP will attempt to use \fIkeysym\fPs such as
611 +\fIxvkbd\fP will attempt to use \fIkeysym\fPs such as
612 \fIXK_KP_1\fP instead of \fIXK_1\fP.
614 Resource `\fBxvkbd.keypadKeysym: true\fP' has the same function.
615 @@ -881,7 +878,7 @@ it is possible to edit the assigned stri
618 On \fIXFree86\fP, resolution switch with
619 -\fICtrl + Alt + Keypad-Plus\fP and \fICtrl + Alt + Keypad-Minus\fP
620 +\fICtrl + Alt + Keypad-Plus\fP and \fICtrl + Alt + Keypad-Minus\fP
622 However, \fICtrl + Alt + Backspace\fP will not be simulated.