Subversion Repositories Kolibri OS

Rev

Rev 3840 | Rev 9118 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1792 yogev_ezra 1
key:
2
    mcall 2
3
    cmp   [extended_key],1
4
    je	  .extended_key
5
    test  al, al
6
    jnz   still
7
    cmp   ah, 0xE0
8
    jne   @f
9
    mov   [extended_key],1
10
    jmp   still
11
@@:
12
    cmp   ah,15
13
    jne   .no_tab
14
    inc   [select_panel_counter]
15
    and   [select_panel_counter],1b
16
    call  draw_left_panel
17
    call  draw_right_panel
18
    jmp   still
19
.no_tab:
20
    cmp   ah,72   ; arrow up
21
    je	  key_72.1
22
    cmp   ah,80   ; arrow down
23
    je	  key_80.1
24
    cmp   ah,28   ; Enter
25
    je	  key_28.1
26
    cmp   ah,17   ; W
27
    je    set_background
28
    cmp   ah,19   ; R
29
    je	  reload_dir_1
30
    cmp   ah,42
31
    je	  key_shift_up
32
    cmp   ah,54
33
    je	  key_shift_up
2345 mario79 34
    cmp   ah,142
35
    je	  exit_dir_1	; BackSpace Up
1792 yogev_ezra 36
    cmp   ah,170
37
    je	  key_shift_down
38
    cmp   ah,182
39
    je	  key_shift_down
40
    cmp   ah,29
41
    je	  key_ctrl_up.1
42
    cmp   ah,157
43
    je	  key_ctrl_down.1
44
    cmp   ah,56
45
    je	  key_alt_up.1
46
    cmp   ah,184
47
    je	  key_alt_down.1
48
    cmp   ah,206 ; NumPad+ Up
49
    je    NumPad_plus_Up
50
    cmp   ah,202 ; NumPad- Up
51
    je    NumPad_minus_Up
52
    cmp   ah,183 ; NumPad* Up
53
    je    NumPad_sneg_Up
54
    cmp   ah,158
55
    je    symbol_a_up
56
    cmp   ah,59    ; down F1
57
    je	  f_key_f1
58
    cmp   ah,60    ; down F2
59
    je	  f_key_f2
60
    cmp   ah,61    ; down F3
61
    je	  f_key_f3 ;sort_name
62
    cmp   ah,62    ; down F4
63
    je	  f_key_f4 ;sort_type
64
    cmp   ah,63    ; down F5
65
    je	  f_key_f5 ;sort_size
66
    cmp   ah,64    ; down F6
67
    je	  f_key_f6 ; sort_date
68
    cmp   ah,65    ; down F7
69
    je	  f_key_f7 ;
70
    cmp   ah,66    ; down F8
71
    je	  f_key_f8 ; delete_file
72
    cmp   ah,88    ; down F12
73
    je	  f_key_f12
74
    jmp  still
75
;-------------------------------------------------------------
76
.extended_key:
77
    mov  [extended_key],0
78
key_80:
79
    cmp  ah,80	; arrow down
80
    jne  key_72
81
.1:
82
    cmp  [select_panel_counter],0
83
    jne  .right_1
84
    mov  eax,[left_folder_block]
85
    dec  eax
86
    imul eax,10
87
    cmp  ax,[left_start_draw_cursor_line]
88
    jbe  .marked_action   ;still
89
    mov  ax,[left_start_draw_cursor_line]
90
    add  ax,10
3840 mario79 91
    cmp  ax,[left_panel_y_correct_size_y]
1792 yogev_ezra 92
    jae  @f
93
.add_1:
94
    add  [left_start_draw_cursor_line],10
5684 leency 95
    call draw_left_panel
1792 yogev_ezra 96
    mov  [drawing_panel_folder],1
5684 leency 97
	jmp  still
1792 yogev_ezra 98
.all:
99
    sub  ecx,10 shl 16
100
    mov  edx,0xffffff
3840 mario79 101
	mcall
1792 yogev_ezra 102
    mov  [not_clear_lines],1
103
    call draw_folder_data
104
    mov  [not_clear_lines],0
105
    jmp  still
106
.marked_action:
107
    cmp  [marked_action],0
108
    je   still
109
    mov  [marked_action],0
110
    call draw_left_panel
111
    jmp  still
112
.marked_action_1:
113
    cmp  [marked_action],0
114
    je   still
115
    mov  [marked_action],0
116
    call draw_right_panel
117
    jmp  still
118
@@:
119
    mov  eax,[left_folder_block]
120
    sub  eax,[max_panel_line]
121
    test eax,0x80000000
122
    jz	 @f
123
    xor  eax,eax
124
@@:
125
    cmp  [marked_action],0
126
    jne   @f
127
    cmp  [left_start_draw_line],eax
128
    je	 still
129
@@:
130
    mov  [marked_action],0
131
    inc  [left_start_draw_line]
132
    call draw_left_panel
133
    jmp  still
134
.right_1:
135
    mov  eax,[right_folder_block]
136
    dec  eax
137
    imul eax,10
138
    cmp  ax,[right_start_draw_cursor_line]
139
    jbe  .marked_action_1   ;still
140
    mov  ax,[right_start_draw_cursor_line]
141
    add  ax,10
3840 mario79 142
    cmp  ax,[right_panel_y_correct_size_y]
1792 yogev_ezra 143
    jae  @f
144
.add_2:
145
    add  [right_start_draw_cursor_line],10
5684 leency 146
    call draw_right_panel
1792 yogev_ezra 147
    mov  [drawing_panel_folder],2
5684 leency 148
    jmp  still
1792 yogev_ezra 149
@@:
150
    mov  eax,[right_folder_block]
151
    sub  eax,[max_panel_line]
152
    test eax,0x80000000
153
    jz	 @f
154
    xor  eax,eax
155
@@:
156
    cmp  [marked_action],0
157
    jne  @f
158
    cmp  [right_start_draw_line],eax
159
    je	 still
160
@@:
161
    mov  [marked_action],0
162
    inc  [right_start_draw_line]
163
    call draw_right_panel
164
    jmp  still
165
;-------------------------------------------------------------
166
key_72:
167
    cmp  ah,72	;arrow up
168
    jne  key_81
169
.1:
170
    cmp  [select_panel_counter],0
171
    jne  .right_1
172
    mov  ax,[left_start_draw_cursor_line]
173
    add  ax,[left_panel_y.start_y]
174
    cmp  [left_panel_y.start_y],ax
175
    je	 @f
176
    sub  [left_start_draw_cursor_line],10
5684 leency 177
    call draw_left_panel
1792 yogev_ezra 178
    mov  [drawing_panel_folder],1
5684 leency 179
	jmp  still
1792 yogev_ezra 180
.all:
181
    add  ecx,10 shl 16
182
    mov  edx,0xffffff
3840 mario79 183
	mcall
1792 yogev_ezra 184
    mov  [not_clear_lines],1
185
    call draw_folder_data
186
    mov  [not_clear_lines],0
187
    jmp  still
188
@@:
189
    cmp  [left_start_draw_line],0
190
    je	 still
191
    dec  [left_start_draw_line]
192
    call draw_left_panel
193
    jmp  still
194
.right_1:
195
    mov  ax,[right_start_draw_cursor_line]
196
    add  ax,[right_panel_y.start_y]
197
    cmp  [right_panel_y.start_y],ax
198
    je	 @f
199
    sub  [right_start_draw_cursor_line],10
5684 leency 200
    call draw_right_panel
1792 yogev_ezra 201
    mov  [drawing_panel_folder],2
5684 leency 202
    jmp  still
1792 yogev_ezra 203
@@:
204
    cmp  [right_start_draw_line],0
205
    je	 still
206
    dec  [right_start_draw_line]
207
    call draw_right_panel
208
    jmp  still
209
;-------------------------------------------------------------
210
key_81:
211
    cmp  ah,81 ; PageDown
212
    jne  key_73
213
    mov  eax,[max_panel_line]
214
    cmp  [select_panel_counter],0
215
    jne  .right_1
216
    mov  ebx,[left_folder_block]
217
    sub  ebx,eax
218
    test ebx,0x80000000
219
    jnz  .left_2
220
    sub  ebx,[left_start_draw_line]
221
    cmp  ebx,eax
222
    ja  .ok_1
223
    mov  ebx,[left_folder_block]
224
    sub  ebx,eax
225
    call prepare_data_left_down
226
    ja   @f
227
    cmp  ebx,[left_start_draw_line]
228
    je   still
229
@@:
230
    mov  [left_start_draw_line],ebx
231
.left_3:
232
    dec  eax
233
    imul eax,10
234
.left_1:
235
    mov  [left_start_draw_cursor_line],ax
236
    call draw_left_panel
237
    jmp  still
238
.left_2:
239
    mov  eax,[left_folder_block]
240
    sub  eax,[left_start_draw_line]
241
    dec  eax
242
    imul eax,10
243
    cmp  ax,[left_start_draw_cursor_line]
244
    jbe  still
245
    jmp  .left_1
246
.ok_1:
247
    add  [left_start_draw_line],eax
248
    call draw_left_panel
249
    jmp  still
250
.right_1:
251
    mov  ebx,[right_folder_block]
252
    sub  ebx,eax
253
    test ebx,0x80000000
254
    jnz  .right_3
255
    sub  ebx,[right_start_draw_line]
256
    cmp  ebx,eax
257
    jae  .ok_2
258
    mov  ebx,[right_folder_block]
259
    sub  ebx,eax
260
    call prepare_data_right_down
261
    ja   @f
262
    cmp  ebx,[right_start_draw_line]
263
    je   still
264
@@:
265
    mov  [right_start_draw_line],ebx
266
.right_4:
267
    dec  eax
268
    imul eax,10
269
.right_2:
270
    mov  [right_start_draw_cursor_line],ax
271
    call draw_right_panel
272
    jmp  still
273
.right_3:
274
    mov  eax,[right_folder_block]
275
    sub  eax,[right_start_draw_line]
276
    dec  eax
277
    imul eax,10
278
    cmp  ax,[right_start_draw_cursor_line]
279
    jbe  still
280
    jmp  .right_2
281
.ok_2:
282
    add  [right_start_draw_line],eax
283
    call draw_right_panel
284
    jmp  still
285
;-------------------------------------------------------------
286
prepare_data_right_down:
287
    mov  ecx,[right_folder_block]
288
    sub  ecx,[right_start_draw_line]
289
    dec  ecx
290
    imul ecx,10
291
    cmp  cx,[right_start_draw_cursor_line]
292
    ret
293
;-------------------------------------------------------------
294
prepare_data_left_down:
295
    mov  ecx,[left_folder_block]
296
    sub  ecx,[left_start_draw_line]
297
    dec  ecx
298
    imul ecx,10
299
    cmp  cx,[left_start_draw_cursor_line]
300
    ret
301
;-------------------------------------------------------------
302
key_73:
303
    cmp  ah,73 ; PageUp
304
    jne  key_71
305
    mov  eax,[max_panel_line]
306
    cmp  [select_panel_counter],0
307
    jne  .right_1
308
    mov  ebx,[left_start_draw_line]
309
    sub  ebx,eax
310
    test ebx,0x8000000
311
    jz	 @f
312
    cmp  [left_start_draw_line],0
313
    jne  .draw_line_1
314
    cmp  [left_start_draw_cursor_line],0
315
    je	 still
316
    mov  [left_start_draw_cursor_line],0
317
.draw_line_1:
318
    mov  [left_start_draw_line],0
319
    call draw_left_panel
320
    jmp  still
321
@@:
322
    sub  [left_start_draw_line],eax
323
    call draw_left_panel
324
    jmp  still
325
.right_1:
326
    mov  ebx,[right_start_draw_line]
327
    sub  ebx,eax
328
    test ebx,0x80000000
329
    jz	 @f
330
    cmp  [right_start_draw_line],0
331
    jne  .draw_line_2
332
    cmp  [right_start_draw_cursor_line],0
333
    je	 still
334
    mov  [right_start_draw_cursor_line],0
335
.draw_line_2:
336
    mov  [right_start_draw_line],0
337
    call draw_right_panel
338
    jmp  still
339
@@:
340
    sub  [right_start_draw_line],eax
341
    call draw_right_panel
342
    jmp  still
343
;-------------------------------------------------------------
344
key_71:
345
    cmp  ah,71 ; Home
346
    jne  key_79
347
    cmp  [select_panel_counter],0
348
    jne  .right_1
349
    cmp  [left_start_draw_line],0
350
    jne   .draw_left_panel
351
    cmp  [left_start_draw_cursor_line],0
352
    je	 still
353
.draw_left_panel:
354
    mov  [left_start_draw_line],0
355
    mov  [left_start_draw_cursor_line],0
356
    call draw_left_panel
357
    jmp  still
358
.right_1:
359
    cmp  [right_start_draw_line],0
360
    jne   .draw_right_panel
361
    cmp  [right_start_draw_cursor_line],0
362
    je	 still
363
.draw_right_panel:
364
    mov  [right_start_draw_line],0
365
    mov  [right_start_draw_cursor_line],0
366
    call draw_right_panel
367
    jmp  still
368
;-------------------------------------------------------------
369
key_79:
370
    cmp  ah,79 ; End
371
    jne  key_28
372
    cmp  [select_panel_counter],0
373
    jne  .right_1
374
    mov  eax,[left_folder_block]
375
    sub  eax,[max_panel_line]
376
    test eax,0x80000000
377
    jnz  key_81.left_2
378
    call prepare_data_left_down
379
    ja   @f
380
    cmp  eax,[left_start_draw_line]
381
    je   still
382
@@:
383
    mov  [left_start_draw_line],eax
384
    mov  eax,[max_panel_line]
385
    jmp  key_81.left_3
386
.right_1:
387
    mov  eax,[right_folder_block]
388
    sub  eax,[max_panel_line]
389
    test eax,0x80000000
390
    jnz  key_81.right_3
391
    call prepare_data_right_down
392
    ja   @f
393
    cmp  eax,[right_start_draw_line]
394
    je   still
395
@@:
396
    mov  [right_start_draw_line],eax
397
    mov  eax,[max_panel_line]
398
    jmp  key_81.right_4
399
;-------------------------------------------------------------
400
key_28:
401
    cmp  ah,28 ; Enter
402
    jne  key_ctrl_up
403
.1:
404
    cmp  [shift_flag],1
405
    je	 still
406
    cmp  [ctrl_flag],1
407
    je	 still
408
    cmp  [alt_flag],1
409
    je	 files_information
410
 
411
    mov  [open_param],0
412
.2:
413
    cmp  [select_panel_counter],0
414
    jne  .right_1
415
    mov  ebp,read_folder_name    ;read_folder.name
416
    call  calculate_left_data_1
417
    add  esi,32
418
    cmp  [exit_dir],1
419
    je	 .up_patch
420
    test [esi],byte 0x10
421
    jz	 file_no_folder
422
    cmp  [open_param],0
423
    jne  still
424
    cmp  [esi+40],word 2Eh
425
    je	 still
426
    cmp  [esi+40],word '..'
427
    je	 .up_patch
428
    call calculate_key_28_1
429
    mov  [left_start_draw_cursor_line],0
430
    mov  [left_start_draw_line],0
431
    jmp  proc_read_folder
432
.up_patch:
433
    call calculate_key_28_2
434
    jmp  proc_read_folder
435
.right_1:
436
    mov  ebp,read_folder_1_name   ;read_folder_1.name
437
    call calculate_right_data_1
438
    add  esi,32
439
    cmp  [exit_dir],1
440
    je	 .up_patch_1
441
    test [esi],byte 0x10
442
    jz	 file_no_folder
443
    cmp  [esi+40],word 2Eh
444
    je	 still
445
    cmp  [esi+40],word '..'
446
    je	 .up_patch_1
447
    call calculate_key_28_1
448
    mov  [right_start_draw_cursor_line],0
449
    mov  [right_start_draw_line],0
450
    jmp  proc_read_folder_1
451
.up_patch_1:
452
    call calculate_key_28_2
453
    jmp  proc_read_folder_1
454
;---------------------------------------------------------------------
455
calculate_key_28_1:
456
;    mov  edi,read_folder.name-1
457
    mov  edi,ebp
458
    dec  edi
459
    inc  ebp
460
@@:
461
    inc  edi
462
    cmp  [edi],byte 0
463
    jne  @r
464
    cmp  edi,ebp ;read_folder.name+1
465
    je	 @f
466
    mov  al,'/'
467
    mov [edi],al
468
    inc  edi
469
@@:
470
    add  esi,40
471
@@:
472
    cld
473
    lodsb
474
    stosb
475
    cmp al,0
476
    jnz   @r
477
    ret
478
;---------------------------------------------------------------------
479
calculate_key_28_2:
480
    mov  [exit_dir],0
481
    mov  edi,ebp ;read_folder.name
482
@@:
483
    inc  edi
484
    cmp  [edi],byte 0
485
    jne  @r
486
    mov  [extension_size],edi
487
    dec  edi
488
@@:
489
    dec  edi
490
    cmp  [edi],byte '/'
491
    jne  @r
492
    mov  eax,ebp ;read_folder.name
493
    cmp  edi,eax
494
    jbe  @f
495
    mov  [edi],byte 0
496
@@:
497
    inc  edi
498
    mov  [temp_counter_dword],edi
499
    dec  edi
500
    sub  [extension_size],edi
501
    mov  [search_pre_folder],1
502
    ret
503
;---------------------------------------------------------------------
504
set_background:
505
    cmp  [shift_flag],1
506
    je   .shift
507
    cmp  [ctrl_flag],1
508
    jne  still
509
    mov  [open_param],background_stretch
510
    jmp  key_28.2
511
.shift:
512
    mov  [open_param],background_tile
513
    jmp  key_28.2
514
;---------------------------------------------------------------------
515
reload_dir_1:
516
    cmp  [ctrl_flag],0
517
    je	 still
518
    jmp  reload_dir
519
;---------------------------------------------------------------------
520
symbol_a_up:
521
    cmp  [shift_flag],1
522
    je	 still
523
    cmp  [ctrl_flag],1
524
    je	 .ctrl
525
    cmp  [alt_flag],1
526
    je	 still
527
    jmp  still
528
.ctrl:
529
    mov  [mark_action_counter],0
530
    jmp  mark_all_file
531
;---------------------------------------------------------------------
532
NumPad_plus_Up:
533
    cmp  [shift_flag],1
534
    je	 still
535
    cmp  [ctrl_flag],1
536
    je	 .ctrl
537
    cmp  [alt_flag],1
538
    je	 still
539
    jmp  still
540
.ctrl:
541
    mov  [mark_action_counter],0
542
    jmp  mark_all_file
543
;---------------------------------------------------------------------
544
NumPad_minus_Up:
545
    cmp  [shift_flag],1
546
    je	 still
547
    cmp  [ctrl_flag],1
548
    je	 .ctrl
549
    cmp  [alt_flag],1
550
    je	 still
551
    jmp  still
552
.ctrl:
553
    mov  [mark_action_counter],1
554
    jmp  mark_all_file
555
;---------------------------------------------------------------------
556
NumPad_sneg_Up:
557
    cmp  [shift_flag],1
558
    je	 still
559
    cmp  [ctrl_flag],1
560
    je	 .ctrl
561
    cmp  [alt_flag],1
562
    je	 still
563
    jmp  still
564
.ctrl:
565
    mov  [mark_action_counter],2
566
    jmp  mark_all_file
567
;---------------------------------------------------------------------
568
f_key_f1:
569
;sort_name:
570
    cmp  [shift_flag],1
571
    je	 still
572
    cmp  [ctrl_flag],1
573
    je	 still
574
    cmp  [alt_flag],1
575
    je	 draw_left_select_disk_menu
576
    jmp  help_start
577
;---------------------------------------------------------------------
578
f_key_f2:
579
;sort_name:
580
    cmp  [shift_flag],1
581
    je	 still
582
    cmp  [ctrl_flag],1
583
    je	 still
584
    cmp  [alt_flag],1
585
    je	 draw_right_select_disk_menu
586
    jmp  still
587
;---------------------------------------------------------------------
588
f_key_f3:
589
;sort_name:
590
    cmp  [shift_flag],1
591
    je	 still
592
    cmp  [ctrl_flag],1
593
    je	 .ctrl
594
    cmp  [alt_flag],1
595
    je	 still
596
    jmp  still
597
.ctrl:
598
    cmp  [select_panel_counter],1
599
    je	 right_sort_name
600
    jmp  left_sort_name
601
;---------------------------------------------------------------------
602
f_key_f4:
603
;sort_type:
604
    cmp  [shift_flag],1
605
    je	 still
606
    cmp  [ctrl_flag],1
607
    je	 .ctrl
608
    cmp  [alt_flag],1
609
    je	 still
610
    jmp  open_file_f4
611
.ctrl:
612
    cmp  [select_panel_counter],1
613
    je	 right_sort_type
614
    jmp  left_sort_type
615
;---------------------------------------------------------------------
616
f_key_f5:
617
;sort_size:
618
    cmp  [shift_flag],1
619
    je	 still
620
    cmp  [ctrl_flag],1
621
    je	 .ctrl
622
    cmp  [alt_flag],1
623
    je	 still
624
    jmp  copy_file_f5
625
.ctrl:
626
    cmp  [select_panel_counter],1
627
    je	 right_sort_size
628
    jmp  left_sort_size
629
;---------------------------------------------------------------------
630
f_key_f6:
631
;sort_date:
632
    cmp  [shift_flag],1
633
    je	 still
634
    cmp  [ctrl_flag],1
635
    je	 .ctrl
636
    cmp  [alt_flag],1
637
    je	 still
638
    jmp  move_file_f6
639
.ctrl:
640
    cmp  [select_panel_counter],1
641
    je	 right_sort_date
642
    jmp  left_sort_date
643
;---------------------------------------------------------------------
644
f_key_f7:
645
    cmp  [shift_flag],1
646
    je	 still
647
    cmp  [ctrl_flag],1
648
    je	 still
649
    cmp  [alt_flag],1
650
    je	 still
651
    jmp  create_directory
652
;---------------------------------------------------------------------
653
f_key_f8:
654
    cmp  [shift_flag],1
655
    je	 still
656
    cmp  [ctrl_flag],1
657
    je	 still
658
    cmp  [alt_flag],1
659
    je	 still
660
    jmp  delete_file
661
;---------------------------------------------------------------------
662
f_key_f12:
663
    cmp  [shift_flag],1
664
    je	 still
665
    cmp  [ctrl_flag],1
666
    je	 still
667
    cmp  [alt_flag],1
668
    je	 still
669
    jmp  exit_apl
670
;---------------------------------------------------------------------
671
key_shift_up:
672
    cmp  [shift_flag],1
673
    je	 still
674
    mov  [shift_flag],1
675
    jmp  key_alt_down.for_all
676
;---------------------------------------------------------------------
677
key_shift_down:
678
    mov  [shift_flag],0
679
    jmp  key_alt_down.for_all
680
;---------------------------------------------------------------------
681
key_ctrl_up:
682
    cmp   ah,29
683
    jne   key_ctrl_down
684
.1:
685
    cmp  [ctrl_flag],1
686
    je	 still
687
    mov  [ctrl_flag],1
688
    jmp  key_alt_down.for_all
689
;---------------------------------------------------------------------
690
key_ctrl_down:
691
    cmp   ah,157
692
    jne   key_alt_up
693
.1:
694
    mov  [ctrl_flag],0
695
    jmp  key_alt_down.for_all
696
;---------------------------------------------------------------------
697
key_alt_up:
698
    cmp   ah,56
699
    jne   key_alt_down
700
.1:
701
    cmp  [alt_flag],1
702
    je	 still
703
    mov  [alt_flag],1
704
    jmp  key_alt_down.for_all
705
;---------------------------------------------------------------------
706
key_alt_down:
707
    cmp   ah,184
708
    jne   key_insert
709
.1:
710
    mov  [alt_flag],0
711
.for_all:
712
    call erase_fbutton
713
    call draw_fbutton
714
    jmp  still
715
;---------------------------------------------------------------------
716
key_insert:
717
    cmp   ah,82   ; Insert
718
    je	  mark_file
719
    cmp   ah,83
2616 mario79 720
    je	  f_key_f8	;delete_file
1792 yogev_ezra 721
key_end:
722
    jmp  still
723
;---------------------------------------------------------------------