EdKeyMapping.dcl 1.14 KB
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
definition module EdKeyMapping

3
4
// configuring the key mapping of the editor

5
6
7
8
9
10
from StdFile		import :: Files
from StdPSt			import :: PSt
from StdIOCommon	import :: KeyboardState, :: SpecialKey
from StdMaybe		import :: Maybe
from StdOverloaded	import class ==, class toString, class fromString
from EdActionType	import :: Action
Diederik van Arkel's avatar
Diederik van Arkel committed
11
12
13
14
15
16
17
18

:: KeyMapping

// The first two arguments are there to circumvent the
// restriction that cyclic dependencies of definition modules are
// not allowed. The type should be:
//   configureKeyMapping :: (PSt EditorState .p) -> (PSt EditorState .p)
// But then you have to import EdState which imports this module...
19
// => can be removed in Clean 2.0!
Diederik van Arkel's avatar
Diederik van Arkel committed
20

Diederik van Arkel's avatar
Diederik van Arkel committed
21
configureKeyMapping :: KeyMapping (KeyMapping (PSt .l) -> (PSt .l)) (PSt .l) -> (PSt .l)
Diederik van Arkel's avatar
Diederik van Arkel committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

macKeyMapping		:: KeyMapping
//pcKeyMapping		:: KeyMapping

findAction			:: !KeyboardState !KeyMapping -> Maybe Action


ReadKeyMapFile	:: !{#Char} !*Files -> ((!KeyMapping, !Bool, !{#Char}),!*Files)
SaveKeyMapFile	:: !{#Char} !KeyMapping !*Files -> (!Bool, !*Files);

// avoid warnings
:: KeyCode
instance == KeyCode
instance toString KeyCode
instance fromString KeyCode
instance fromString SpecialKey