mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-26 13:59:57 +00:00
nitpicker: Remove <global-keys> compound node
This commit is contained in:
parent
dbebfd624e
commit
295b4241aa
@ -122,13 +122,11 @@ append config {
|
|||||||
<domain name="default" color="#ffffff"/>
|
<domain name="default" color="#ffffff"/>
|
||||||
<policy label="" domain="default"/>
|
<policy label="" domain="default"/>
|
||||||
|
|
||||||
<global-keys>
|
<global-key name="KEY_SCROLLLOCK" operation="xray" />
|
||||||
<key name="KEY_SCROLLLOCK" operation="xray" />
|
<global-key name="KEY_SYSRQ" operation="kill" />
|
||||||
<key name="KEY_SYSRQ" operation="kill" />
|
<global-key name="KEY_PRINT" operation="kill" />
|
||||||
<key name="KEY_PRINT" operation="kill" />
|
<global-key name="KEY_F11" operation="kill" />
|
||||||
<key name="KEY_F11" operation="kill" />
|
<global-key name="KEY_F12" operation="xray" />
|
||||||
<key name="KEY_F12" operation="xray" />
|
|
||||||
</global-keys>
|
|
||||||
</config>
|
</config>
|
||||||
</start>
|
</start>
|
||||||
<start name="launchpad">
|
<start name="launchpad">
|
||||||
|
@ -33,16 +33,13 @@ keyboard shortcuts, namely the X-ray mode and the kill mode. The keys
|
|||||||
for toggling those functions can be defined as follows:
|
for toggling those functions can be defined as follows:
|
||||||
|
|
||||||
! <config>
|
! <config>
|
||||||
! <global-keys>
|
! <global-key name="KEY_SCROLLLOCK" operation="xray" />
|
||||||
! <key name="KEY_SCROLLLOCK" operation="xray" />
|
! <global-key name="KEY_PRINT" operation="kill" />
|
||||||
! <key name="KEY_PRINT" operation="kill" />
|
|
||||||
! </global-keys>
|
|
||||||
! </config>
|
! </config>
|
||||||
|
|
||||||
The '<global-keys>' node contains the policy for handling global keys. Each
|
Each '<global-key>' node expresses a rule for a named key. The 'operation'
|
||||||
'<key>' subnode expresses a rule for named key. The 'operation' attribute
|
attribute refers nitpicker's built-in operations. In the example above, the
|
||||||
refers nitpicker's built-in operations. In the example above, the X-ray
|
X-ray mode can be activated via the scroll-lock key and the kill mode can be
|
||||||
mode can be activated via the scroll-lock key and the kill mode can be
|
|
||||||
activated via the print key.
|
activated via the print key.
|
||||||
|
|
||||||
Alternatively to specifying an 'operation' attribute, a key node can contain
|
Alternatively to specifying an 'operation' attribute, a key node can contain
|
||||||
@ -55,10 +52,8 @@ the key specified in the '<key>' node. For the routing of global keys to
|
|||||||
clients, the order of '<key>' nodes is important. If multiple nodes exists for
|
clients, the order of '<key>' nodes is important. If multiple nodes exists for
|
||||||
different labels, the first match will take effect. For example:
|
different labels, the first match will take effect. For example:
|
||||||
|
|
||||||
! <global-keys>
|
! <global-key name="KEY_F11" label="launchpad -> testnit" />
|
||||||
! <key name="KEY_F11" label="launchpad -> testnit" />
|
! <global-key name="KEY_F11" label="launchpad" />
|
||||||
! <key name="KEY_F11" label="launchpad" />
|
|
||||||
! </global-keys>
|
|
||||||
|
|
||||||
The "launchpad" client will receive all key sequences starting with F11 unless
|
The "launchpad" client will receive all key sequences starting with F11 unless
|
||||||
the "launchpad -> testnit" program is running. As soon as testnit gets started
|
the "launchpad -> testnit" program is running. As soon as testnit gets started
|
||||||
|
@ -33,14 +33,16 @@ void Global_keys::apply_config(Session_list &session_list)
|
|||||||
for (unsigned i = 0; i < NUM_POLICIES; i++)
|
for (unsigned i = 0; i < NUM_POLICIES; i++)
|
||||||
_policies[i].undefine();
|
_policies[i].undefine();
|
||||||
|
|
||||||
|
char const *node_type = "global-key";
|
||||||
|
|
||||||
using Genode::Xml_node;
|
using Genode::Xml_node;
|
||||||
try {
|
try {
|
||||||
Xml_node node = Genode::config()->xml_node().sub_node("global-keys").sub_node("key");
|
Xml_node node = Genode::config()->xml_node().sub_node(node_type);
|
||||||
|
|
||||||
for (; ; node = node.next("key")) {
|
for (; ; node = node.next(node_type)) {
|
||||||
|
|
||||||
if (!node.has_attribute("name")) {
|
if (!node.has_attribute("name")) {
|
||||||
PWRN("attribute 'name' missing in <key> config node");
|
PWRN("attribute 'name' missing in <global-key> config node");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user