When you hit a key on your keyboard, you want it to go to the console you are working on and application(s) running on that console should get the event delivered. Other applications running on other consoles should not get the event (for obvious security reasons). When you want to switch to another physical (dual-head) or virtual (also known as VTs) console, you press a key combination to switch and then want now your chars to be sent to the right console. In other words, you need the system manages the focus for you in a convenient, deterministic and safe manner.

The KgiFocus is the central place in KGI where KgiInput are connected to KgiDisplay.

These connections are at the same time dynamic and static. Static because the relationship between display and input instances is predefined. Dynamic because you can register any KgiInput (ps/2, usb mouse or keyboards) or KgiDisplay to the KgiFocus.

So what is predifined relationship? Let's have a look at the following:

 device 0 on focus 0, display 0, console 0
 device 1 on focus 0, display 0, console 1
 device 2 on focus 0, display 1, console 2
 device 3 on focus 0, display 1, console 3
 device 4 on focus 0, display 1, console 4
 device 5 on focus 0, display 1, console 5
 device 6 on focus 0, display 1, console 6
 device 7 on focus 0, display 1, console 7
 device 8 on focus 0, display 1, console 8
 device 9 on focus 0, display 1, console 9
 device 10 on focus 0, display 1, console 10
 device 11 on focus 0, display 1, console 11
 device 12 on focus 1, display 2, console 0
 device 13 on focus 1, display 2, console 1
 device 14 on focus 1, display 2, console 2
 device 15 on focus 1, display 2, console 3
 device 16 on focus 1, display 2, console 4
 device 17 on focus 1, display 2, console 5
 device 18 on focus 1, display 2, console 6
 device 19 on focus 1, display 2, console 7
 device 20 on focus 1, display 2, console 8
 device 21 on focus 1, display 2, console 9
 device 22 on focus 1, display 2, console 10
 device 23 on focus 1, display 2, console 11

It presents the case of 2 keyboards (represented by 2 focuses) for which one has 3 screens. Each focus can reach 12 consoles (typically what you get with a PC keyboard with F1..F12). Focus 1 is totally linked to display 2 (1 keyboard + 1 screen wired config) and focus 1 can either control consoles 0 and 1 through display 0 and others through display 1. It means that with focus 0, when you hit ALT+F1 you edit commands on display 0, ALT-F3 : you edit on display 1, ALT-F1 you change VT on display 0 and ALT-F4 to ALT-F12 : you switch to VTs on display 1.

KgiFocus (last edited 2008-06-17 21:38:06 by localhost)