Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/vt/vt_core.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
/* Bell pitch/duration. */ | /* Bell pitch/duration. */ | ||||
#define VT_BELLDURATION (SBT_1S / 20) | #define VT_BELLDURATION (SBT_1S / 20) | ||||
#define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ | #define VT_BELLPITCH (1193182 / 800) /* Approx 1491Hz */ | ||||
#define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ | #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ | ||||
(vw)->vw_number) | (vw)->vw_number) | ||||
static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"vt(9) parameters"); | "vt(9) parameters"); | ||||
static VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); | static VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); | ||||
static VT_SYSCTL_INT(enable_bell, 0, "Enable bell"); | static VT_SYSCTL_INT(enable_bell, 0, "Enable bell"); | ||||
static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); | static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); | ||||
static VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); | static VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); | ||||
static VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); | static VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); | ||||
/* Allow to disable some keyboard combinations. */ | /* Allow to disable some keyboard combinations. */ | ||||
▲ Show 20 Lines • Show All 965 Lines • ▼ Show 20 Lines | vtterm_devctl(bool enabled, bool hushed, int hz, sbintime_t duration) | ||||
free(buf, M_VT); | free(buf, M_VT); | ||||
} | } | ||||
static void | static void | ||||
vtterm_bell(struct terminal *tm) | vtterm_bell(struct terminal *tm) | ||||
{ | { | ||||
struct vt_window *vw = tm->tm_softc; | struct vt_window *vw = tm->tm_softc; | ||||
struct vt_device *vd = vw->vw_device; | struct vt_device *vd = vw->vw_device; | ||||
/* piggyback screen reader hangup on the bell event */ | |||||
vt_screen_reader_hup(); | |||||
vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL, | vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL, | ||||
vw->vw_bell_pitch, vw->vw_bell_duration); | vw->vw_bell_pitch, vw->vw_bell_duration); | ||||
if (!vt_enable_bell) | if (!vt_enable_bell) | ||||
return; | return; | ||||
if (vd->vd_flags & VDF_QUIET_BELL) | if (vd->vd_flags & VDF_QUIET_BELL) | ||||
▲ Show 20 Lines • Show All 2,097 Lines • Show Last 20 Lines |