.\"***************************************************************************
-.\" Copyright 2018-2021,2022 Thomas E. Dickey *
+.\" Copyright 2018-2022,2023 Thomas E. Dickey *
.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
.\" *
.\" Permission is hereby granted, free of charge, to any person obtaining a *
.\" authorization. *
.\"***************************************************************************
.\"
-.\" $Id: form_driver.3x,v 1.40 2022/02/12 20:03:40 tom Exp $
-.TH form_driver 3X 2022-02-12 "ncurses 6.4" "Library calls"
+.\" $Id: form_driver.3x,v 1.43 2023/07/01 15:46:10 tom Exp $
+.TH form_driver 3X 2023-07-01 "ncurses 6.4" "Library calls"
.de bP
.ie n .IP \(bu 4
.el .IP \(bu 2
\fBint form_driver(FORM *\fIform\fB, int \fIc\fB);\fR
.br
\fBint form_driver_w(FORM *\fIform\fB, int \fIc\fB, wchar_t \fIwch\fB);\fR
-.br
.SH DESCRIPTION
.SS form_driver
Once a form has been posted (displayed), you should funnel input events to it
.bP
The input is the KEY_MOUSE special key associated with an mouse event.
.SS form_driver_w
-.PP
This extension simplifies the use of the forms library using wide characters.
The input is either a key code (a request) or a wide character
returned by \fBget_wch\fP(3X).
to enable the library to determine whether the parameter
is a wide character or a request.
.SS Form-driver requests
-.PP
The form driver requests are as follows:
.TS
l l
to ensure that the contents
meet whatever constraints an application may attach using \fBset_field_type\fP.
.PP
-.PP
You can validate a field without making any changes to it using
\fBREQ_VALIDATION\fP.
The form driver also validates a field in these cases:
data from the window associated with the field
to the field buffer.
.SS Mouse handling
-.PP
If the second argument is the KEY_MOUSE special key, the associated
mouse event is translated into one of the above pre-defined requests.
Currently only clicks in the user window (e.g., inside the form display
or the mouse event could not be translated
into a form request an \fBE_REQUEST_DENIED\fP is returned.
.SS Application-defined commands
-.PP
If the second argument is neither printable nor one of the above
pre-defined form requests, the driver assumes it is an application-specific
command and returns \fBE_UNKNOWN_COMMAND\fP. Application-defined commands