Keyboard mapping example - SQL Script

 

Below is a SQL script that will create two example keyboard mappings.

1. Item comment operation - with no parameter - is linked to button 'a' on the keyboard

2. Item comment operation - with a parameter - is linked to button 'b' on the keyboard

Example SQL script


use MYDATABASENAME

DECLARE @DATAAREAID NVARCHAR(4)
SET @DATAAREAID = 'LSR' -- set this to the current DataAreaId in your database if it is not LSR

DECLARE @KEYBOARDMAPPINGID NVARCHAR(20)
SET @KEYBOARDMAPPINGID = 'DEMO'

-- Set the keyboard mapping ID in the hardware profile
UPDATE POSHARDWAREPROFILE
SET KEYBOARDMAPPINGID = @KEYBOARDMAPPINGID

-- Create the keyboard mapping header
INSERT INTO POSISKEYBOARDMAPPINGTABLE VALUES (@KEYBOARDMAPPINGID, 'My keyboard mapping', @DATAAREAID)

-- Create a keyboard mapping for Item comment operation for character 'a'
INSERT INTO POSISKEYBOARDMAPPINGTRANS VALUES (@KEYBOARDMAPPINGID, 97, 'a', 103, '', @DATAAREAID)

-- Create a keyboard mapping for Item comment operation with a parameter for character 'b'
INSERT INTO POSISKEYBOARDMAPPINGTRANS VALUES (@KEYBOARDMAPPINGID, 98, 'a', 103, 'My keyboard mapping in action', @DATAAREAID)

-- To see the ID's for the operations 
SELECT ID, DESCRIPTION FROM OPERATIONS WHERE TYPE = 2 ORDER BY DESCRIPTION
}