# CutBox.app

## Coverage Report

#### Created: 2024-03-12 03:40

    .../Source/App/JSFuncSearchPreview/JSFuncSearchAndPreviewView+KeyDown.swift

    Line

    Count

    Source

    1

    //

    2

    //  JSFuncSearchAndPreviewView+KeyDown.swift

    3

    //  CutBox

    4

    //

    5

    //  Created by Jason Milkins on 17/5/18.

    6

    //  Copyright © 2018-2023 ocodo. All rights reserved.

    7

    //

    8

    9

    import RxSwift

    10

    import Carbon.HIToolbox

    11

    12

    extension JSFuncSearchAndPreviewView {

    13

    14

    5

        override func keyDown(with event: NSEvent) {

    15

    5

            switch (event.key, event.modifiers) {

    16

    5

            case (kVK_UpArrow, _),

    17

    1

                 (kVK_DownArrow, _):

    18

    1

                self.hideSearchResults(false)

    19

    1

                if !self.js.isEmpty {

    20

    1

                    self.itemsList.keyDown(with: event)

    21

    5

                }

    22

    5

    23

    5

            case (kVK_ANSI_T, [.command]):

    24

    1

                self.events.onNext(.cycleTheme)

    25

    5

    26

    5

            case (kVK_Return, _):

    27

    1

                self.events.onNext(.closeAndPaste)

    28

    5

    29

    5

            case (kVK_Escape, _):

    30

    1

                self.events.onNext(.justClose)

    31

    5

    32

    5

            default:

    33

    1

                break

    34

    5

            }

    35

    5

        }

    36

    }