driver_manager-pc: numlock handling

This patch incorporates key remapping rules for the input filter that
depend on the global numlock state.
This commit is contained in:
Norman Feske 2017-11-20 21:28:18 +01:00 committed by Christian Helmuth
parent 3ea960932e
commit f36bc80bd7
4 changed files with 55 additions and 14 deletions

View File

@ -1,6 +1,7 @@
content: drivers.config fb_drv.config input_filter.config en_us.chargen
content: drivers.config fb_drv.config input_filter.config en_us.chargen \
numlock_remap.config
drivers.config:
drivers.config numlock_remap.config:
cp $(REP_DIR)/recipes/raw/drivers_managed-pc/$@ $@
fb_drv.config input_filter.config:

View File

@ -179,12 +179,24 @@
</route>
</start>
<!-- toggle key mappings depending on the numlock state -->
<start name="numlock_remap_rom" priority="-1">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="numlock_remap.config"/> </service>
<service name="ROM" label="numlock"> <parent label="numlock"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="input_filter" caps="90" priority="-1">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Input"/> </provides>
<route>
<service name="ROM" label="config"> <parent label="input_filter.config"/> </service>
<service name="ROM" label="en_us.chargen"> <parent label="en_us.chargen"/> </service>
<service name="ROM" label="numlock.remap"> <child name="numlock_remap_rom"/> </service>
<service name="ROM" label="capslock"> <parent label="capslock"/> </service>
<service name="Input" label="ps2"> <child name="ps2_drv"/> </service>
<service name="Input" label="usb"> <child name="usb_drv"/> </service>
@ -220,7 +232,7 @@
</route>
</start>
<start name="dynamic" caps="800" priority="0">
<start name="dynamic" caps="1000" priority="0">
<binary name="init"/>
<resource name="RAM" quantum="1G"/>
<provides>

View File

@ -3,16 +3,20 @@
<input label="usb"/>
<output>
<chargen>
<merge>
<accelerate max="50" sensitivity_percent="1000" curve="127">
<button-scroll>
<input name="ps2"/>
<vertical button="BTN_MIDDLE" speed_percent="-10"/>
<horizontal button="BTN_MIDDLE" speed_percent="-10"/>
</button-scroll>
</accelerate>
<input name="usb"/>
</merge>
<remap>
<!-- <key name="KEY_CAPSLOCK" to="KEY_ESC"/> -->
<include rom="numlock.remap"/>
<merge>
<accelerate max="50" sensitivity_percent="1000" curve="127">
<button-scroll>
<input name="ps2"/>
<vertical button="BTN_MIDDLE" speed_percent="-10"/>
<horizontal button="BTN_MIDDLE" speed_percent="-10"/>
</button-scroll>
</accelerate>
<input name="usb"/>
</merge>
</remap>
<mod1>
<key name="KEY_LEFTSHIFT"/> <key name="KEY_RIGHTSHIFT"/>
<rom name="capslock"/>

View File

@ -0,0 +1,24 @@
<config>
<input name="numlock_enabled" rom="numlock" node="numlock">
<attribute name="enabled" /> </input>
<output node="remap">
<if>
<has_value input="numlock_enabled" value="yes" />
<then>
<inline>
<key name="KEY_KP0" to="KEY_INSERT"/>
<key name="KEY_KP1" to="KEY_END"/>
<key name="KEY_KP2" to="KEY_DOWN"/>
<key name="KEY_KP3" to="KEY_PAGEDOWN"/>
<key name="KEY_KP4" to="KEY_LEFT"/>
<key name="KEY_KP6" to="KEY_RIGHT"/>
<key name="KEY_KP7" to="KEY_HOME"/>
<key name="KEY_KP8" to="KEY_UP"/>
<key name="KEY_KP9" to="KEY_PAGEUP"/>
<key name="KEY_KPCOMMA" to="KEY_DELETE"/>
</inline>
</then>
</if>
</output>
</config>