From owner-freebsd-questions@freebsd.org Tue Dec 5 00:08:57 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF0CE6F306 for ; Tue, 5 Dec 2017 00:08:57 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59BB37FA90 for ; Tue, 5 Dec 2017 00:08:56 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([92.195.191.233]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPA (Nemesis) id 0M1kNy-1fFMGN1PYo-00thfd; Tue, 05 Dec 2017 01:08:45 +0100 Date: Tue, 5 Dec 2017 01:08:44 +0100 From: Polytropon To: Jack Rosenthal Cc: freebsd-questions@freebsd.org Subject: Re: Implementing multi-layer keyboard in FreeBSD syscons, and control keys repeat rate Message-Id: <20171205010844.93a1164c.freebsd@edvax.de> In-Reply-To: <20171204003039.GA16209@rosenth.al> References: <20171204003039.GA16209@rosenth.al> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:YLiHjJN1oZNdHdm3V8PSceuwtevjSXZjca7xFuysfgG9u2d/9zK GOAvP+K3fNDXV6ahBnd9c1Ta0VZLTwD98XTjZd/4dkCyNSGzLQyT+wacgXf7AbMsvpEmUY3 wX8CMbNNwKiI7XZxlAZirmv5SLJkxxOOUkILwkFENvvcCpjNerjvfNa8dLRJQZT0PsOhJD9 HdevUxuFQI0vMLdaCuaIg== X-UI-Out-Filterresults: notjunk:1;V01:K0:IjpyAQyYk44=:ordhC7S7uqVuyTn7vTJFny Kyrzx5680Q3KD+1FyRTxa57BL9BpID5UjrAIkisidvlybKJQ/blRBhzWWKHRHzsfQvJuyIxHE luhXEyopTOihXo2Q7SSUnG4qEGGZkb9Fb8lNiDrkd85aNpvQmzB0b1hxBdjmvyY4jfD03lZXU eGjqOveKt0lsH5dh74LeETBaq1Sy+fmrIDhhxkoOYimfKQvDit/3uzQqiPIm17Bavb3khh1TM MdbuGUkeHoQWLp70Rk47fNcFK31zL2rzYP275vp2+/xOuBdM4wVaAeaO0bvbTteLf/fsh5K24 Nt41DWOiyADEqjj+ikbusFLFo9Pt24cirvs3hnSM+09YkzjuugQpU/d3sjy6HhZP0QtGuQlAA fKJVu00NAR9menl1QNr+SQ+FCSQJ2qJAFJwnX50WfGIX0jpEHa2kGHBFeaKd2BI8NxPyYW4OE Mlwpq7/c0FRPlixSsIn7+mkVeyjxEWBdip6iUhdq5uDRzDcQR/Imnb79Wvn5oaw2nlCaJ9/eN K1EP/n5Hj2X6wWfTCrCOzJ7YcTgFbf40rCRzfGjU/DCurnxHNEOka9VIje9lnLi98hi62aV/s BW3W67bIJCAUSfupfcN7j+CFW23Fsoj53DYmgtoSycLU/ctvBXs5c9FXzAMc2Tsg0MtaNKI1I GvWfhDfoLJqe2BDQVlHqYlcRaQ5HxOU1AZLjM1RP78ibOiE4ynaMWQcqQENYQfriLBYgyGdTP E4VYQFGONo66zYh7p8U2mWYlkuv2O3FLE284quiJH7Dy2Rb2Q4sRHSgkpgc= X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2017 00:08:57 -0000 On Sun, 3 Dec 2017 17:30:39 -0700, Jack Rosenthal wrote: > I'm trying to implement a multi-layer keyboard layout for the FreeBSD > console (sort of like the Neo layout, there's more things that change > the keys than just shift). If you're curious, the keyboard spec is here: > > https://github.com/jackrosenthal/threelayout > > Here's what I've got so far: > > https://github.com/jackrosenthal/threelayout/blob/master/freebsd/3l.kbd Interesting effort. However, I think traditional syscons (sc) will be abolished soon and fully replaced by NewCons (vt) due to the fact that modern X doesn't work until you switch to vt. Maybe you can also investigate how vt does things, and find a solution there? > Essentially, from what I can tell, FreeBSD only supports Shift, Ctrl, > and Alt (and combinations there of) for modifiers. So I've currently got > symbols on the 'Alt' layer, cursor controls and numpad on 'Ctrl', and > the real control keys on 'Ctrl+Shift'. >From my understanding (many years old!), this is correct, as those are the esential modifier keys on the i386-oriented hardware architecture for keyboards and their interfaces. > Besides having to use 'Ctrl+Shift' to use the real control keys, the > arrows etc. on the 'Ctrl' layer seem not to repeat when held down. That is strange. Repeat should be present on all layers where a "normal" key is part of the combination (even ESC). Additionally, the lower levels (keyboard driver and sc input handler) typically deal with "key down" and "key up" events obtained from the keyboard interface and will generate the repeat from that (for keys that can have repeat abilities). > So, a couple of questions: > > 1. Any hacks to get that key repeat working? Honestly the most > inconvenient part... No idea anymore, sorry... my days of lowlevel hardware interface hacking are over... ;-) > 2. Any way to make the Ctrl key send Ctrl+Shift? I was thinking that I > could make a function key for that, but cannot find any way to do > that from the manual (kbdcontrol). This is something to be implemented in the keyboard driver directly, i. e., atkbd or ukbd - and re-check with the lower-level sc (or vt?) interface to those drivers, usually there are ioctl()s doing it. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...