@@ -113,78 +113,6 @@ export function updateInputDisplay(value: string): void {
113
113
}
114
114
}
115
115
116
- // export function updateInputDisplay (value: string): void {
117
- // const isDigit = !Number.isNaN(Number(value))
118
-
119
- // if ($inputDisplay != null) {
120
- // switch (value) {
121
- // case 'NumpadMultiply':
122
- // case 'KeyX':
123
- // case 'X':
124
- // case 'x':
125
- // case '*':
126
- // updateOperation($inputDisplay, '*')
127
- // break
128
- // case 'NumpadDivide':
129
- // case '/':
130
- // updateOperation($inputDisplay, '/')
131
- // break
132
- // case 'NumpadAdd':
133
- // case '+':
134
- // updateOperation($inputDisplay, '+')
135
- // break
136
- // case 'NumpadSubtract':
137
- // case '-':
138
- // updateOperation($inputDisplay, '-')
139
- // break
140
- // case 'NumpadDecimal':
141
- // case '.':
142
- // updateValueWithPoint($inputDisplay)
143
- // break
144
- // case 'Backspace':
145
- // $inputDisplay.value = $inputDisplay.value.slice(0, -1)
146
- // break
147
- // case 'Delete':
148
- // $inputDisplay.value = ''
149
- // isOperationUsed = false
150
- // break
151
- // case 'Enter':
152
- // isOperationUsed = false
153
-
154
- // if ($inputDisplay.value === '') {
155
- // $inputDisplay.value = '0'
156
- // return
157
- // }
158
-
159
- // $inputDisplay.value = getResult($inputDisplay)
160
- // break
161
- // default:
162
- // if (isDigit) {
163
- // const lastValue = getLastNumber($inputDisplay.value)
164
- // $inputDisplay.value = lastValue === '0' ? $inputDisplay.value.slice(0, -1) + value : $inputDisplay.value + value
165
- // isOperationUsed = false
166
- // }
167
- // }
168
-
169
- // $inputDisplay.scrollLeft = $inputDisplay.scrollWidth
170
- // }
171
- // }
172
-
173
- // export function updateKeyActive (event: KeyboardEvent, classListMethod: 'add' | 'remove'): void {
174
- // try {
175
- // for (const { key, code } of keypadList) {
176
- // const codeExists = Array.isArray(code)
177
-
178
- // if (key === event.key || (codeExists && code.includes(event.code))) {
179
- // const id = `#key-${codeExists ? code[0] : key}`
180
- // $(id)?.classList[classListMethod]('active')
181
- // }
182
- // }
183
- // } catch (error) {
184
- // console.error(error)
185
- // }
186
- // }
187
-
188
116
export function updateKeyActive ( event : KeyboardEvent , classListMethod : 'add' | 'remove' ) : void {
189
117
try {
190
118
const keyItem = keypadList . find ( ( { key, code } ) => matchesKeyOrCode ( event , key , code ) )
0 commit comments