about summary refs log tree commit diff stats
path: root/dwm.h
Commit message (Expand)AuthorAgeFilesLines
...
* removed Client->gravarg@mig292006-12-121-1/+0
* removed gravitate for the momentarg@mig292006-12-111-1/+0
* removed viewall signature from dwm.harg@mig292006-11-301-1/+0
* added man page entryarg@mig292006-11-271-1/+1
* added togglefloat to hg tip (i consider this useful for some cases), using MO...arg@mig292006-11-271-0/+1
* fifififarg@mig292006-11-221-1/+1
* applied Gottox' windowarea patcharg@mig292006-11-161-0/+1
* renamed resizecol into resizemaster 2.1arg@mig292006-10-311-1/+1
* applied sanders try2 patcharg@mig292006-10-271-1/+1
* moved MOUSEMASK into event.c (not used in other places)Anselm R. Garbe2006-10-161-1/+0
* do* has no Arg arument anymore (never called directly) 1.9Anselm R. Garbe2006-10-061-3/+3
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-2/+1
* removed the stack position stuffAnselm R. Garbe2006-10-051-6/+0
* keep master ratio on resizecol -> arrangeAnselm R. Garbe2006-10-051-3/+3
* simplified dotile()Anselm R. Garbe2006-10-051-1/+0
* removed useless updatemasterAnselm R. Garbe2006-09-291-1/+0
* removed the direction flippingAnselm R. Garbe2006-09-291-2/+0
* added the new dotile as described on mlAnselm R. Garbe2006-09-291-3/+6
* prelim of dotile()Anselm R. Garbe2006-09-291-0/+1
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+7
* applied Jukkas patchAnselm R. Garbe2006-09-281-0/+2
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-0/+1
* added configure(), but this doesn't really fix those frking broken SDL appsarg@mmvi2006-09-261-0/+1
* applied sanders jukka patcharg@mmvi2006-09-251-1/+1
* applied Jukkas patcharg@mmvi2006-09-251-6/+6
* small change to achieve Jukka's last proposalarg@mmvi2006-09-221-1/+2
* fixed issue pointed out by Jukkaarg@mmvi2006-09-221-1/+0
* implemented the maximization as I described on the mailinglist, this feels be...arg@mmvi2006-09-221-2/+2
* improved intro comment in dwm.h, updated config.mkarg@mmvi2006-09-201-3/+3
* some simplifications to intro in dwm.harg@mmvi2006-09-191-13/+13
* some more simplifications of intro comment in dwm.h, this should suffice for ...Anselm R. Garbe2006-09-121-20/+14
* made introduction comment in dwm.h shorterAnselm R. Garbe2006-09-121-20/+15
* added a general comment to dwm.h how dwm is basically organizedAnselm R. Garbe2006-09-121-0/+40
* some other simplificationsAnselm R. Garbe2006-09-111-11/+11
* small change to comments, renamed two set* functions in client.c into update*Anselm R. Garbe2006-09-111-11/+11
* small fixAnselm R. Garbe2006-09-111-2/+2
* added some commentsAnselm R. Garbe2006-09-111-72/+69
* using a global stack for focus recovery on arrange() - seems to work greatAnselm R. Garbe2006-09-071-1/+2
* moved transient_for tag inheritance to settagsAnselm R. Garbe2006-09-061-1/+1
* renamed resizetile into resizecolAnselm R. Garbe2006-09-051-1/+1
* s/growcol/resizetile/gAnselm R. Garbe2006-09-051-1/+1
* I really need column growing, now pushing upstreamAnselm R. Garbe2006-09-051-0/+1
* applied Sanders max_and_focus.patchAnselm R. Garbe2006-09-041-2/+1
* added viewall to mainstream (only Ross Mohns version, not the toggle)Anselm R. Garbe2006-08-311-0/+1
* still something wrong with reorder()Anselm R. Garbe2006-08-291-2/+1
* added attach/detach functions which don't attach at the begin of list, but at...Anselm R. Garbe2006-08-291-0/+2
* trying a different configurationAnselm R. Garbe2006-08-251-2/+2
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-251-4/+7
* back to 3 colorsAnselm R. Garbe2006-08-251-2/+3
* 3->4 colorsAnselm R. Garbe2006-08-241-3/+2
'n4' href='#n4'>4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

                  

                                                                                  
                                                
                                    
                                              
          

                                                            
                                                       

   
                                   
                   
                         

                         
                        

                         
                          

                                                                       
                        
                         



                      
 
                                
                                                                                

   
                        
                                                                 


                       
                                                               


                         
                                                                   

   
                       
                                                               

   



                                                                                              


                              










                                  












                           
   
-- Keyboard driver

Modifiers = {'lctrl', 'rctrl', 'lalt', 'ralt', 'lshift', 'rshift', 'lgui', 'rgui'}

function App.keypressed(key, scancode, isrepeat)
  if array.find(Modifiers, key) then
    -- do nothing when the modifier is pressed
    return
  end
  -- include the modifier(s) when the non-modifer is pressed
  App.keychord_pressed(App.combine_modifiers(key), key)
end

function App.combine_modifiers(key)
  local result = ''
  if App.ctrl_down() then
    result = result..'C-'
  end
  if App.alt_down() then
    result = result..'M-'
  end
  if App.shift_down() then
    result = result..'S-'  -- don't try to use this with letters/digits
  end
  if App.cmd_down() then
    result = result..'s-'
  end
  result = result..key
  return result
end

function App.any_modifier_down()
  return App.ctrl_down() or App.alt_down() or App.shift_down() or App.cmd_down()
end

function App.ctrl_down()
  return App.modifier_down('lctrl') or App.modifier_down('rctrl')
end

function App.alt_down()
  return App.modifier_down('lalt') or App.modifier_down('ralt')
end

function App.shift_down()
  return App.modifier_down('lshift') or App.modifier_down('rshift')
end

function App.cmd_down()
  return App.modifier_down('lgui') or App.modifier_down('rgui')
end

function App.is_cursor_movement(key)
  return array.find({'left', 'right', 'up', 'down', 'home', 'end', 'pageup', 'pagedown'}, key)
end

array = {}

function array.find(arr, elem)
  if type(elem) == 'function' then
    for i,x in ipairs(arr) do
      if elem(x) then
        return i
      end
    end
  else
    for i,x in ipairs(arr) do
      if x == elem then
        return i
      end
    end
  end
  return nil
end

function array.any(arr, f)
  for i,x in ipairs(arr) do
    local result = f(x)
    if result then
      return result
    end
  end
  return false
end