# sdl12-compat: Fix scancode for LCTRL on Mac OS.

**URL:** <https://discourse.libsdl.org/t/sdl12-compat-fix-scancode-for-lctrl-on-mac-os/31791>\
**Category:** SDL Commits\
**Created:** [June 10, 2021, 9:22am UTC](https://discourse.libsdl.org/t/sdl12-compat-fix-scancode-for-lctrl-on-mac-os/31791 "2021-06-10T09:22:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [June 10, 2021, 9:22am UTC](https://discourse.libsdl.org/t/sdl12-compat-fix-scancode-for-lctrl-on-mac-os/31791/1 "2021-06-10T09:22:02Z")

</div>

> <https://github.com/libsdl-org/sdl12-compat/commit/f7e60cd37e29e43ef30f350117fe7424225afa07>
>
> This was a typo: it accidentally was 4B (KP\_DIVIDE) rather than 3B
> (LCTRL).
> 
> Th…is should fix the Left Control key in DOSBox on Macs with
> usescancodes=true

```diff
From f7e60cd37e29e43ef30f350117fe7424225afa07 Mon Sep 17 00:00:00 2001
From: David Gow <[EMAIL REDACTED]>
Date: Thu, 10 Jun 2021 14:29:30 +0800
Subject: [PATCH] Fix scancode for LCTRL on Mac OS.

This was a typo: it accidentally was 4B (KP_DIVIDE) rather than 3B
(LCTRL).

This should fix the Left Control key in DOSBox on Macs with
usescancodes=true
---
 src/SDL12_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index fdc57f0..30cee4f 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -2467,7 +2467,7 @@ Scancode20to12(SDL_Scancode sc)
     CASESCANCODE20TO12(KP_PLUS, 0x56, 0x44);
     CASESCANCODE20TO12(L, 0x2E, 0x25);
     CASESCANCODE20TO12(LALT, 0x40, 0x3A);
- CASESCANCODE20TO12(LCTRL, 0x25, 0x4B);
+ CASESCANCODE20TO12(LCTRL, 0x25, 0x3B);
     CASESCANCODE20TO12(LEFT, 0x00, 0x7B);
     CASESCANCODE20TO12(LEFTBRACKET, 0x22, 0x21);
     CASESCANCODE20TO12(LGUI, 0x85, 0x37);

```
